pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Heikki Linnakangas <hlinnakangas@vmware.com>
To: Michael Paquier <michael.paquier@gmail.com>
Cc: PostgreSQL mailing lists <pgsql-odbc@postgresql.org>
Subject: Re: Running regression tests on Windows
Date: Thu, 12 Jun 2014 21:55:50 +0300
Message-ID: <5399F7B6.7000208@vmware.com> (raw)
In-Reply-To: <CAB7nPqQLyynCh8sVCXm2hJea64gViXa2UB3JiVdZ9tx7DWNA1w@mail.gmail.com>
References: <CAB7nPqSZ1E42fdAaP4NjDG6HeC14WuWRN0rhR_eFHTuMV0KBdg@mail.gmail.com>
	<537B8520.1070800@vmware.com>
	<CAB7nPqQLyynCh8sVCXm2hJea64gViXa2UB3JiVdZ9tx7DWNA1w@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-odbc>

On 05/21/2014 08:53 AM, Michael Paquier wrote:
> On Wed, May 21, 2014 at 1:38 AM, Heikki Linnakangas <hlinnakangas@vmware.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.

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/<testname>-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



view thread (9+ messages)  latest in thread

Message-ID: <5399F7B6.7000208@vmware.com>
Permalink:  ../5399F7B6.7000208@vmware.com/
Also on:    postgresql.org/message-id/5399F7B6.7000208@vmware.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-odbc@postgresql.org
  Cc: hlinnakangas@vmware.com, michael.paquier@gmail.com
  Subject: Re: Running regression tests on Windows
  In-Reply-To: <5399F7B6.7000208@vmware.com>
  References: <CAB7nPqSZ1E42fdAaP4NjDG6HeC14WuWRN0rhR_eFHTuMV0KBdg@mail.gmail.com> <537B8520.1070800@vmware.com> <CAB7nPqQLyynCh8sVCXm2hJea64gViXa2UB3JiVdZ9tx7DWNA1w@mail.gmail.com> <5399F7B6.7000208@vmware.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox