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..53bef01 --- /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