Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WvAAO-0000z3-7q for pgsql-odbc@arkaria.postgresql.org; Thu, 12 Jun 2014 18:56:04 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WvAAN-0002rq-9T for pgsql-odbc@arkaria.postgresql.org; Thu, 12 Jun 2014 18:56:03 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1WvAAM-0002rk-OJ for pgsql-odbc@postgresql.org; Thu, 12 Jun 2014 18:56:02 +0000 Received: from smtp-outbound-2.vmware.com ([208.91.2.13]) by magus.postgresql.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1WvAAI-0004E7-C7 for pgsql-odbc@postgresql.org; Thu, 12 Jun 2014 18:56:01 +0000 Received: from sc9-mailhost3.vmware.com (sc9-mailhost3.vmware.com [10.113.161.73]) by smtp-outbound-2.vmware.com (Postfix) with ESMTP id C55F8985D2; Thu, 12 Jun 2014 11:55:52 -0700 (PDT) Received: from zcs-prod-ext-mta-2.vmware.com (zcs-prod-ext-mta-2.vmware.com [10.113.62.224]) by sc9-mailhost3.vmware.com (Postfix) with ESMTP id C171546724; Thu, 12 Jun 2014 11:55:52 -0700 (PDT) Received: from zcs-prod-ext-mta-2.vmware.com (localhost.localdomain [127.0.0.1]) by zcs-prod-ext-mta-2.vmware.com (Postfix) with ESMTP id 5DE55C0064; Thu, 12 Jun 2014 11:56:05 -0700 (PDT) Received: from [192.168.1.90] (zimbra-prod-ext-proxy-vip.vmware.com [10.113.63.87]) by zcs-prod-ext-mta-2.vmware.com (Postfix) with ESMTPSA; Thu, 12 Jun 2014 11:56:04 -0700 (PDT) Message-ID: <5399F7B6.7000208@vmware.com> Date: Thu, 12 Jun 2014 21:55:50 +0300 From: Heikki Linnakangas Organization: VMware User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Icedove/24.5.0 MIME-Version: 1.0 To: Michael Paquier CC: PostgreSQL mailing lists Subject: Re: Running regression tests on Windows References: <537B8520.1070800@vmware.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -7.6 (-------) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-odbc Precedence: bulk Sender: pgsql-odbc-owner@postgresql.org On 05/21/2014 08:53 AM, Michael Paquier wrote: > On Wed, May 21, 2014 at 1:38 AM, Heikki Linnakangas > wrote: > >> On 05/20/2014 04:31 PM, Michael Paquier wrote: >> >>> Now, I am trying to figure out how to run those regressions with >>> pg_regress. On Linux, we use a given combination of odbcinst.ini and >>> odbc.ini with a launcher that actually sets ODBCSYSINI to set the path >>> where looking for the .ini files. I have been trying several combinations >>> of --launcher as well as setting up ODBCSYSINI in either the makefile or >>> as >>> an environment viriable without success, pg_regress continues to complain >>> with the following error: >>> ! SQLDriverConnect failed. >>> ! IM002=[Microsoft][ODBC Driver Manager] Data source name not found and no >>> default driver specified >>> So obviously pg_regress is not able to find the initialization files >>> properly... >>> >> >> I believe the ODBCSYSINI environment variable is specific to unixodbc, and >> not obeyed by the Windows ODBC library. I don't know the preferred way to >> do it on Windows would be. >> > After some research on Redmond's website, It happens that you need to add > manually an ODBC driver in the Windows registry to do that. Ugh. Did you look at the ODBCCONF.exe program? For the first version, I think we can punt on that. Let's just require that you install the driver manually, using the installer for example, and create the DSN manually. > Btw, I have been able to do some hacking on that, finishing with the > patch attached to support regressions on Windows. Great! > The following things are done: > - nmake is used from a Windows SDK to run the tests. > - Addition of documentation in test/README.txt. > - test/src/common.c has been lightly patched to pass some custom parameters > to run the tests with WIN32 as odbcinst.ini/odbc.ini cannot be used. > Actually the driver name, server IP and database name are needed in the > connection string. Hmm. If we just require the user to create the DSN manually, we don't need to do anything different in common.c. > - Because Windows does not like much using non-full paths when invocating > the *-test executables, I have moved all the tests to use input/ and > output/ with @abd_srcdir@. This has the huge advantage to make the output > transparent on all the OSes and all the development environments. Oh. I don't think that's really necessary. Windows can handle relative paths just fine. With the \! syntax, though, it seems that Windows wants an extra pair of quotes. So this works: \! "src/-test" That also works on Unix, although the extra quotes are not necessary there, so let's just do that. > - A registry file that can be imported in the Windows registry has been > added in the patch as it is troublesome to create new registry entries > manually. A couple of clicks is enough to import the file and register a > custom ODBC driver for the regression tests. That's specified in the docs > as well. The registry file didn't get through in the .diff, it just said "Binary files /dev/null and b/test/win_registry_key.reg differ". Anyway, as I said above I think the right approach is to give an odbc.conf command line in the README that you can run. Or maybe run it from the makefile automatically. > - Some alternate outputs have been added for the unicode driver. Oh, WVARCHAR vs VARCHAR, I see.. I committed a modified version of this patch. It's based on yours, with a few changes: - I didn't do the moving of files sql -> source and expected -> output. - Added the double-quotes to the \! commands instead. - I moved the list of tests to a separate file, called "tests", which is included in both the Unix Makefile and win.mak. That makes it unnecessary to update two makefiles when you add a new test (I bet about 50% of all commits that add new test case would forget to update both files :-) ). It also makes it unnecessary to run ./configure every time you add a new test, which is nice during development - reworked win.mak somewhat, to avoid the moving of files (BTW, there is no "mv" command on plain Windows; it's called "move".) - I didn't add the alternate outputs yet - later.. > Even with this patch, I am still seeing some tests failing. Those bugs are > different issues and the idea is to come back to fix them once this patch > gets in. I'm also getting some failures, and the numeric test program crashes. But at least it's now relatively easy to run the regression tests. - Heikki -- Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-odbc