Re: [HACKERS] question regarding regression tests

2006-09-15 Thread Gevik Babakhani
Thank you.

On Fri, 2006-09-15 at 17:41 -0400, Alvaro Herrera wrote:
> Gevik Babakhani wrote:
> > Folks,
> > 
> > Could someone please provide information about how to create a correct
> > regression test?
> 
> Some information you can find on the PGXS docs:
> 
>
> The scripts listed in the REGRESS variable are used for
> regression testing of your module, just like make
> installcheck is used for the main
> PostgreSQL server.  For this to work you need
> to have a subdirectory named sql/ in your extension's
> directory, within which you put one file for each group of tests you want
> to run.  The files should have extension .sql, which
> should not be included in the REGRESS list in the
> makefile.  For each test there should be a file containing the expected
> result in a subdirectory named expected/, with 
> extension
> .out.  The tests are run by executing make
> installcheck, and the resulting output will be compared to the
> expected files.  The differences will be written to the file
> regression.diffs in diff -c format.
> Note that trying to run a test which is missing the expected file will be
> reported as trouble, so make sure you have all expected
> files.
>
> 
> Note that not all of this applies to the backend regression tests, but
> it should help.  For the backend, you list the tests in the
> serial_schedule and parallel_schedule files.
> 


---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings


Re: [HACKERS] question regarding regression tests

2006-09-15 Thread Alvaro Herrera
Gevik Babakhani wrote:
> Folks,
> 
> Could someone please provide information about how to create a correct
> regression test?

Some information you can find on the PGXS docs:

   
The scripts listed in the REGRESS variable are used for
regression testing of your module, just like make
installcheck is used for the main
PostgreSQL server.  For this to work you need
to have a subdirectory named sql/ in your extension's
directory, within which you put one file for each group of tests you want
to run.  The files should have extension .sql, which
should not be included in the REGRESS list in the
makefile.  For each test there should be a file containing the expected
result in a subdirectory named expected/, with extension
.out.  The tests are run by executing make
installcheck, and the resulting output will be compared to the
expected files.  The differences will be written to the file
regression.diffs in diff -c format.
Note that trying to run a test which is missing the expected file will be
reported as trouble, so make sure you have all expected
files.
   

Note that not all of this applies to the backend regression tests, but
it should help.  For the backend, you list the tests in the
serial_schedule and parallel_schedule files.

-- 
Alvaro Herrerahttp://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

---(end of broadcast)---
TIP 6: explain analyze is your friend