Page 1 of 1

Running the zeoslib test suite.

Posted: 04.09.2010, 21:34
by mdaems
This post is a followup on thread http://zeos.firmos.at/viewtopic.php?t=2604, where guidoaerts asks some more information on how he can run the zeoslib test suite. He wants to document this proces in a knowledge base article, but must be able to do it himself first.

There is some old documentation available on running tests in Delphi, but this documentation is a little dated and assumes you're using the Ant build automation software.

Basically this is the manual proces:
0. Download a full zeoslib source (eg. a bigger snapshot file from http://zeosdownloads.firmos.at or from svn) Official releases and compact snapshots do not contain the test suite.
1. Build and install zeoslib
2. Build the testsuite executables. They must be in the build dir within the package directory for your compiler. (or have the config file from step 3 in the same relative path)
3. Configure the <zeos_path>/databases/test.properties file (on this subject the old docs are still usefull)
4. Run the test suite executable(s)

Steps 2 and 4 depend on your compiler.
Delphi step 2:
1. Install the ztestframework package
2. Compile all ZTest* projects
3. Attention on changing zeoslib sources : you'll have to repeat all steps over and over.(zeoslib+testframework installations and then test builds)
Delphi step 4:
Run all test programs one by one from the build directory. It's possible to use a test suite GUI, but then you must set a zeos.inc directive before compiling.

Lazarus step 2:
Build the ZTestAll Project. There's only one exe containing all tests. (Although not all tests are compiled in yet) Reïnstalling zeoslib + framework shouldn't be ncessary on changing the zeoslib source. The test project uses the sources directly instead of using installed framework binaries. I did it like that as it facilitates fixing bugs enormously.
Lazrus step 4:
Run the test suite. Without parameters this should open the GUI interface (no switches needed in zeos.inc). Possible parameters are :
-b or --batch -> runs the test in command line mode.
-v or --verbose
--suite=<suitename> -> runs only a limited part of the test suite
also some other standard fpcunit options are available when using --batch, I think.

eg 'ztestall --batch -p --format=plain --suite=dbc' is used in fully automated build script.

Mark

Posted: 06.09.2010, 08:48
by guidoaerts
Ok, that's a good start. Especially step 0. Now I know where to start. Thanks.
Guido

Posted: 11.09.2010, 10:48
by guidoaerts
update
I downloaded snapshot ZEOSLIB_TRUNK_REV803.zip.
Here I found a lot of reading stuff, which, I guess, I'd better work through. This is going to keep me busy for a little while.
Guido

Posted: 19.09.2010, 21:23
by mdaems
Hi Guido, did you make some progress on this?

Posted: 20.09.2010, 15:18
by guidoaerts
As I said, I downloaded snapshot ZEOSLIB_TRUNK_REV803.zip and did some carefull reading of the \documentation\fundamentals\docs.
Installed wincvs and, following the Getting-started-doc, issued the command
cvs –d:pserver:anonymous@cvs.sourceforge.net/cvsroot/zeoslib co zeosdbo_rework
That got me an old (2005) version that wouldn't compile in lazarus.

Then I tried to compile zcomponent.lpk from ZEOSLIB_TRUNK_REV803.
Compilation stopped after 3 errors:

C:\ZEOSLIB_TRUNK_REV803\src\component\ZDatasetUtils.pas(394,16) Error: identifier idents no member "DefaultExpression"
C:\ZEOSLIB_TRUNK_REV803\src\component\ZDatasetUtils.pas(564,19) Error: identifier idents no member "UpdateDefaultExpression"
C:\ZEOSLIB_TRUNK_REV803\src\component\ZDatasetUtils.pas(564,68) Error: identifier idents no member "GetColumnDefaultExpression"

So, I'm stuck, no progress.... a few tips could help.
tx,
Guido

update (glad i made this step by myself....)
just running the testall.lpi without installing any zeos stuff.
project compiles with loads of warnings; when the exe runs, it throws three exceptions with message that mysql5 dll's cannot be found. console window closes and ide shows 'execution stopped'
rebuilddatabase fails, where can i tell it to do only firebird? (for now)
does it need the firebirdserver to be on the test-pc?

Guido

Posted: 27.09.2010, 15:00
by guidoaerts
got to the next step:
found \database\test.properties
uncommented all mysql items
put in firebird21 settings
now the zeoslib.gdb cannot be found (reasonable, it isn't there)
I will spend some time trying to find out where to create it, or how to modify the \database\install\install_firebird.bat.
(there is some hardcoded path in it,
"set Database=d:\workshop\zeosdbo_rework\work\database\data\zeoslib.fdb"
and
"set fb_home=d:\sqlserverfarm\firebird\15\bin"
with which I don't know yet what to do...)

In the mean time, hints will be welcome :-)

Guido

Posted: 12.10.2010, 19:17
by guidoaerts
:D
up and running! (thanks to Mark, naturally):
-installed 'full' firebird (to be sure)
-created an empty database for firebird, in the \packages\lazarus\build\data map
-had to put the full path to this database in the test.properties file
-first commented out 'rebuild=yes', and got the GUI (great!)
-with rebuild=yes, it needed a second run to get into the GUI, but now it is all there.
now I am going to play around with it, to understand it better; then give a look at André's patches.
As a HOW-TO, this thread won't do much good, but shortly I will write a step-by-step instruction for Lazarus set up of the test suite. For dummies, like me :?
Guido

Posted: 11.10.2011, 14:59
by papelhigienico
And how analyse the test results?

Here I got before and after the change:

component -> TZTestMasterDetailCase -> TZMasterFields
expected: <2> but was: <5>


A way to check if the change is good is check if the same problems occur after the change? Or I'm wrong?

Posted: 30.10.2011, 20:31
by mdaems
Indeed. Run on an unchanged working copy. Keep the output log (run in batch, that's easier). I call this the reflog. And when changes work out right you shouldn't have more errors than before. (1 exception, there's a non-working MSec test that pops up randomly)

Mark