Running the zeoslib test suite.

The alpha/beta tester's forum for ZeosLib 7.0.x series

Report problems concerning our Delphi 2009+ version and new Zeoslib 7.0 features here.

This is a forum that will be removed once the 7.X version goes into stable!!

Moderators: gto, EgonHugeist, olehs

Locked
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Running the zeoslib test suite.

Post 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
Image
guidoaerts
Senior Boarder
Senior Boarder
Posts: 93
Joined: 01.07.2009, 16:07

Post by guidoaerts »

Ok, that's a good start. Especially step 0. Now I know where to start. Thanks.
Guido
guidoaerts
Senior Boarder
Senior Boarder
Posts: 93
Joined: 01.07.2009, 16:07

Post 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
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post by mdaems »

Hi Guido, did you make some progress on this?
Image
guidoaerts
Senior Boarder
Senior Boarder
Posts: 93
Joined: 01.07.2009, 16:07

Post 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
guidoaerts
Senior Boarder
Senior Boarder
Posts: 93
Joined: 01.07.2009, 16:07

Post 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
guidoaerts
Senior Boarder
Senior Boarder
Posts: 93
Joined: 01.07.2009, 16:07

Post 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
papelhigienico
Expert Boarder
Expert Boarder
Posts: 113
Joined: 06.10.2006, 14:41
Location: Chapecó - Santa Catarina
Contact:

Post 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?
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post 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
Image
Locked