Re: Running regression tests on Windows

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>
Cc: PostgreSQL mailing lists <pgsql-odbc(at)postgresql(dot)org>
Subject: Re: Running regression tests on Windows
Date: 2014-05-21 05:53:09
Message-ID: CAB7nPqQLyynCh8sVCXm2hJea64gViXa2UB3JiVdZ9tx7DWNA1w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-odbc

On Wed, May 21, 2014 at 1:38 AM, Heikki Linnakangas <hlinnakangas(at)vmware(dot)com
> 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. Btw, I have
been able to do some hacking on that, finishing with the patch attached to
support regressions on Windows. 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.
- 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(at)(dot) This has the huge advantage to make the output
transparent on all the OSes and all the development environments.
- 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.
- Some alternate outputs have been added for the unicode driver.
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.
Regards,
--
Michael

Attachment Content-Type Size
20140521_pgodbc_regress_windows.patch text/plain 97.4 KB

In response to

Responses

Browse pgsql-odbc by date

  From Date Subject
Next Message Daniel Díaz 2014-05-21 08:03:19 Disabling scalar functions in a DSN.
Previous Message Heikki Linnakangas 2014-05-20 16:38:56 Re: Running regression tests on Windows