Skip to Content.
Sympa Menu

freetds - RE: [freetds] placeholders and messages

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Frediano Ziglio <freddyz77 AT tin.it>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: RE: [freetds] placeholders and messages
  • Date: Fri, 15 Apr 2005 14:15:05 +0200

Il giorno gio, 14-04-2005 alle 14:13 -0400, Lowden, James K ha scritto:
> > From: ZIGLIO, Frediano, VF-IT
> > Sent: Thursday, April 14, 2005 8:55 AM
> >
> > > > Is there some automated way of using gcc to implement test
> > > > coverage? Or did you mean to use autoconf somehow?
> > >
> > > man gcov.
> > > Briefly
> > > - compile with -fprofile-arcs -ftest-coverage (ie "CFLAGS='-O0
> > > -fprofile-arcs -ftest-coverage' ./configure" and make)
> > > - go in source directory and launch gcov (ie "gcov -c cs.c")
> > > - read cs.c...
> >
> > http://freetds.sourceforge.net/coverage/
>
> Wow. Facinating.
>
> I understand now. gcov measures coverage of whatever code is executed.
> We write the tests (you obviously used the unit tests), and it shows
> which code was exercised. Can that URL be automatically updated?
>

Well.. using some gcc parameter the object itself update some statistics
file when executed. gcov just take these file and produce some output. I
used lcov to produce html output (consider it as a gcov extension). To
make that pages I:
- configured FreeTSD with CFLAGS='-O0 -g -fprofile-arcs -ftest-
coverage' (-O0 is necessary to avoid strange optimizations, -g is
optional)
- make
- 2 make check (one with mssql2k and one with sybase 12.5.2)
- some manual tsql test (with tds version 4.2 and a domain login)
- geninfo/genhtml (from lcov). I used a small script to make geninfo
happy
- tar/gz, scp to copy to shell.sf.net, ssh to unpack file in web (all
manual!!)

So a script can be built. We could also do a PHP page to let other user
to its tests. The good of genhmtl is that it can join multiple
informations file (generated from coverage test by geninfo) to generate
a single coverage test. geninfo and genhtml are perl script so they can
be installed on web. Multiple test would help for example to see joined
coverage using little and bigendian machines.

> I looked at the dblib coverage. A lot of the not-covered code is error
> code, like returning FAIL if dbproc == NULL. I would say it would be a
> waste of time to write a test to make sure every function fails that
> way. But there are functions and functionality that are never touched.
> Looking at bcp.c, I see my own predilections e.g. no test for text and
> data or native mode. Scripting a test with freebcp would help.
>
> Nice work. Thanks.
>

I think so. It would also fine to do some tests with DBD::ODBC
DBD::Sybase and PHP. Not as stop-over but can help to discover problems.

I wrote some automatic test script in misc directory. You can see test-
auto.sh output on http://freetds.sourceforge.net/out/test/out.html
(updated automatically every night that is afternoon for you).

freddy77






Archive powered by MHonArc 2.6.24.

Top of Page