Op 2010-06-21 21:08, bwinfrey het geskryf: > I'm not sure where to post my questions. I'm trying to follow the example > "Persisting and unit testing a simple collection", but I get compiler > errors:
I just got an update for tiOPF v2, to make sure I am on the latest code.
You must use the Lazarus Packages (*.lpk) located at:
<tiopf>/Compilers/FPC/tiOPF.lpk
The tiTestFramework is not part of the Core tiOPF code and thus not
included in the tiOPF.lpk package or its search paths. So you need to
include that path manually to you Project Options. You would also need to
specify the Include Path so the include file used in tiTestFramework can be
found. See attached image for what I have done.
Registering your test suites (in the Initialization section) are also
slightly different: minor differences between FPCUnit & DUnit2.
So your Initialization section needs to look something like this - note the
added text parameter as the first parameter to RegisterTest().
Initialization
RegisterTest('MyTests', TPersonTestCase.Suite);
For your own projects, I would normally not recommend using the test
framework units from the tiOPF project. The tiOPF test framework is rather
complex and one doesn't need such a complex setup for your own projects. So
if you are using FPCUnit for your testing framework, I would use TTestCase
descendants and not TtiTestCase.
> After I added tiQuerySqldbSQLLite3, tiOPFManager to the uses clause:
> * Recompiling tiOPFManager, checksum changed for tiQueryCSV {impl}
> tiOPFManager.pas(9,11) Fatal: Can't find unit tiOPFManager used by
> tiQueryCSV
If you are using tiOPF.lpk package, you control the persistence layer with
compiler defines. Simply uncomment the persistence layour you require and
recompile the tiOPF.lpk package.
* Add tiOPF.lpk as a requirement for your project. Project Inspector
dialog.
* Open tiOPF.lpk by double clicking it in Project Inspector.
* Select "Compiler Options > Other" in the tiOPF.lpk dialog.
* Remove the "x" suffix from the '-dLINK_SQLDB_SQLLite3x' line.
* Add "x" suffixes to all the other -dLINK_xxx lines.
* Click OK, then click Compile
I would recommend you add '-dLINK_SQLDB_SQLLite3' to your own projects
Project Options > Compiler > Other dialog as well. I think this is a bug in
Lazarus IDE.
I hope that helps.
Regards,
- Graeme -
<<attachment: Screenshot2.png>>
------------------------------------------------------------------------------ ThinkGeek and WIRED's GeekDad team up for the Ultimate GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the lucky parental unit. See the prize list and enter to win: http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________ tiOPF-talk mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/tiopf-talk
