Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2013-04

Bored?

20 messages · 5 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Reinier Olislagers

Any Laz dev bored with discussions about how to share file uploads or what splash screen is best?

If so, you can relieve your boredom by implementing the patch in 24251 [Patches] [patch] fix for fpcunit gui testrunner stopping with exception

Thanks ;)

Reinier

Reply by email

Reinier Olislagers
to Vincent Snijders
Vincent Snijders wrote 7 lines
2013/4/15 Reinier Olislagers < <mailto:>> Any Laz dev bored with discussions about how to share file uploads or what splash screen is best? What discussion? I have yet little time, so I might have missed something...

The file sharing discussion on this list; the splash screen stuff on the forum...

Reply by email

Reinier Olislagers
to Graeme Geldenhuys
Graeme Geldenhuys wrote 8 lines
On 15/04/13 14:18, Reinier Olislagers wrote: > If so, you can relieve your boredom by implementing the patch in > 24251 [Patches] [patch] fix for fpcunit gui testrunner stopping with > exception I hope you wrote a unit test to test that exception [for regression testing of course]. ;-)

Mmm yes....
I hope somebody has a patch for the underlying with either fpcunit, guitestrunner or the xml code, or whatever it is that screws with the results ;)
My crystal ball is whispering that both of our expectations won't be met quickly :)

Reply by email

Graeme Geldenhuys
to Reinier Olislagers
Reinier Olislagers wrote
I hope somebody has a patch for the underlying with either fpcunit, guitestrunner or the xml code, or whatever it is that screws with the results ;)

Have you tried FPTest (DUnit2 fork) yet? FPCUnit has a DUnit compatible interface - so switching between the two is easy. I did this for years with tiOPF.

My crystal ball is whispering that both of our expectations won't be met quickly :)

:-)

Regards,
- Graeme -

Reply by email

Reinier Olislagers
to Graeme Geldenhuys
Graeme Geldenhuys wrote 6 lines
On 15/04/13 15:35, Reinier Olislagers wrote: > I hope somebody has a patch for the underlying with either fpcunit, > guitestrunner or the xml code, or whatever it is that screws with the > results ;) Have you tried FPTest (DUnit2 fork) yet?

No. See the bugreport in my first post. I have no interest in trying to get fptest into fpc.

Reply by email

Graeme Geldenhuys
to Reinier Olislagers
Reinier Olislagers wrote
No. See the bugreport in my first post.

I did see it.

I have no interest in trying to get fptest into fpc.

Not what I suggested. I suggested using a better and more reliable unit testing framework - but keeping backwards compatibility with FPCUnit by using the DUnit interface to tests (CheckXXX() methods instead of AssertXXX() methods).

I've been a very long user and contributor of FPCUnit, and it is a very problematic framework.

Regards,
- Graeme -

Reply by email

Michael Van Canneyt
to Graeme Geldenhuys
Graeme Geldenhuys wrote 16 lines
On 15/04/13 18:31, Reinier Olislagers wrote: > No. See the bugreport in my first post. I did see it. > I have no interest in trying to > get fptest into fpc. Not what I suggested. I suggested using a better and more reliable unit testing framework - but keeping backwards compatibility with FPCUnit by using the DUnit interface to tests (CheckXXX() methods instead of AssertXXX() methods). I've been a very long user and contributor of FPCUnit, and it is a very problematic framework.

Let's not exaggerate the problems.

I use it for years, and except for 1 issue, there are no problems. Yes; this one issue is hard to solve. But other than that it works as a test framework should work.

Michael.

Reply by email

luiz americo pereira camara
to Michael Van Canneyt

2013/4/15 Michael Van Canneyt :

Show quoted text 10 lines
On Mon, 15 Apr 2013, Graeme Geldenhuys wrote: > I've been a very long user and contributor of FPCUnit, and it is a very > problematic framework. Let's not exaggerate the problems. I use it for years, and except for 1 issue, there are no problems.

For the record, can you point what is this issue?

Luiz

Reply by email

Michael Van Canneyt
to luiz americo pereira camara
luiz americo pereira camara wrote 13 lines
2013/4/15 Michael Van Canneyt : > > On Mon, 15 Apr 2013, Graeme Geldenhuys wrote: > >> I've been a very long user and contributor of FPCUnit, and it is a very >> problematic framework. > > > Let's not exaggerate the problems. > > I use it for years, and except for 1 issue, there are no problems. For the record, can you point what is this issue?

If you specify 1 test to be executed, part of a suite, and there is a test-decorator for the suite, then the test-decorator is not executed.

for example:

Database
Database.TestObjectA.TestInsert
Database.TestObjectA.TestDelete
Database.TestObjectA.TestUpdate

if there is a testdecorator TConnectToDatabase
for suite Database and I specify --suite=Database.TestObjectA.TestInsert then this decorator is not used.

Other than that, I have literally thousands of tests: no problems.

Michael.

Reply by email

Graeme Geldenhuys
to Michael Van Canneyt: Let's not exaggerate the problems. I use it for years, and except for 1 issue, there are…
Michael Van Canneyt wrote
I use it for years, and except for 1 issue, there are no problems.

Yes the issue you mentioned, plus other decorator issues too. I remember having problems where decorators executed too many times too, in nested tests - causing large test suites to slow down dramatically.

Then there is also the lack of controlling test runs, configurable options, project support inside a test suite, lack of warnings about tests that don't actually call any AssertXXX() methods, more accurate timing (excluding Setup/Teardown times), summary level check support to speed up test suite execution when needed (thus skipping detail level tests) but if the summary test fails then detailed tests will run, memory leak detection and overriding what is acceptable leaks etc etc... Then I haven't even gotten to the GUI and Console runner features.

The list is much larger than just 1 issue. You should take a look at DUnit2/FPTest at some point to see just how far behind FPCUnit is in functionality. FPCUnit development has been dormant for years, and my (and many others) testing needs have grown far beyond what FPCUnit offers.

But yes, if you have a very basic test suite design, or have very basic testing needs, then FPCUnit should suffice I guess.

Regards,
- Graeme -

Reply by email

luiz americo pereira camara
to Graeme Geldenhuys

2013/4/15 Graeme Geldenhuys :

The list is much larger than just 1 issue. You should take a look at DUnit2/FPTest at some point to see just how far behind FPCUnit is in functionality.

Where can we find it?

Any docs?

Is there a GUI runner?

I'm starting now in test world. If i can base my work in a more solid framework, it's better.

Luiz

Reply by email

Graeme Geldenhuys
to luiz americo pereira camara
luiz americo pereira camara wrote
Where can we find it?

FPTest
https://github.com/graemeg/fptest

DUnit2
http://sourceforge.net/projects/dunit2/

Any docs?

There are some docs in each repository, there are also example projects included, plus the DUnit v1 docs also apply to these frameworks.

Is there a GUI runner?

Yes, for VCL and fpGUI. I haven't created a LCL one yet. The Console runner also works very well.

Regards,
- Graeme -

Reply by email

Michael Van Canneyt
to Graeme Geldenhuys: Yes the issue you mentioned, plus other decorator issues too. I remember having problems…
Graeme Geldenhuys wrote 7 lines
On 15/04/13 20:38, Michael Van Canneyt wrote: > > I use it for years, and except for 1 issue, there are no problems. Yes the issue you mentioned, plus other decorator issues too. I remember having problems where decorators executed too many times too, in nested tests - causing large test suites to slow down dramatically.

Exactly. That is the only problem I am aware of.

Then there is also the lack of controlling test runs, configurable options, project support inside a test suite, lack of warnings about tests that don't actually call any AssertXXX() methods,

I have lots of such methods ?

   if xyz then
     fail()
Show quoted text 5 lines
more accurate timing (excluding Setup/Teardown times), summary level check support to speed up test suite execution when needed (thus skipping detail level tests) but if the summary test fails then detailed tests will run, memory leak detection and overriding what is acceptable leaks etc etc...

Memory leak detection is a global problem, addressed in heaptrc. By definition, the testsuite cannot do anything about that.

Then I haven't even gotten to the GUI and Console runner features.

These are not 'problems'.

They are features you happen to miss. Nothing wrong with missing those, but they are not "problems".

So please be more correct in your wording.
What you wrote amounts to spreading FUD, and that is the last thing we need.

Michael.

Reply by email

Graeme Geldenhuys
to Michael Van Canneyt
Michael Van Canneyt wrote 6 lines
> .... lack of warnings about > tests that don't actually call any AssertXXX() methods, I have lots of such methods ? if xyz then fail()

Uh... here is an example of what I am talking about.

---------------------
unit TestCase1;
{$mode objfpc}{$H+}
interface
uses
  Classes, SysUtils, fpcunit, testutils, testregistry;
type
  TTestCase1 = class(TTestCase)
  published
    procedure SilentFailure;
  end;
implementation
procedure TTestCase1.SilentFailure;
var
  i: integer;
begin
  i := 10;
  // Test doesn't actually call AssertXXX() or CheckXXX(), yet FPCUnit
thinks it passed
end;
initialization
  RegisterTest(TTestCase1);
end.
--------------------------

And here is the FPCUnit results..

graemeg at ubuntu:/tmp$ ./fpcunitproject1 -a --format=plain Time:00.000 N:1 E:0 F:0 I:0
TTestCase1 Time:00.000 N:1 E:0 F:0 I:0
00.000 SilentFailure

Number of run tests: 1
Number of errors: 0
Number of failures: 0

Yes a simple example, but this issue is very possible in complex tests, or if the developer got sidetracked. And note, FPCUnit reported no problems or here is the FPTest results:

graemeg at ubuntu:/tmp$ ./project2

FPTest / Testing
.W
Time: 00:00:00.000

OK: 1 tests
There was 1 warning:

1) project2.TMyTestCase.SilentFailure: EPostTestWarning at $00000000004001A0
No checks executed in TestCase

Regards,
- Graeme -

Reply by email

Michael Van Canneyt
to Graeme Geldenhuys
Graeme Geldenhuys wrote 33 lines
On 16/04/13 08:14, Michael Van Canneyt wrote: >> .... lack of warnings about >> tests that don't actually call any AssertXXX() methods, > > I have lots of such methods ? > if xyz then > fail() Uh... here is an example of what I am talking about. Yes a simple example, but this issue is very possible in complex tests, or if the developer got sidetracked. And note, FPCUnit reported no problems or course not. And here is the FPTest results: graemeg at ubuntu:/tmp$ ./project2 FPTest / Testing .W Time: 00:00:00.000 OK: 1 tests There was 1 warning: 1) project2.TMyTestCase.SilentFailure: EPostTestWarning at $00000000004001A0 No checks executed in TestCase

I understand, but then I'd be stuck with lots of useless warnings, since there is no way to differentiate a real from a false one.

Better no warnings than lots of false warnings.

Michael.

Reply by email

Graeme Geldenhuys
to Michael Van Canneyt
Michael Van Canneyt wrote 5 lines
I understand, but then I'd be stuck with lots of useless warnings, since there is no way to differentiate a real from a false one. Better no warnings than lots of false warnings.

I don't understand you statement. What false warnings? The test didn't actually do any checks - so shouldn't be considered a valid test case.

FPCUnit reports: Errors and Failures.
FPTest reports: Errors, Failures, Warnings and Excluded Tests

The "no test executed" warnings can be toggled on or off at runtime too. So if you didn't want to see it, you don't have to - but it boggles the mind why you would want to hide such a test oversight. You can also tell the framework to promote "no test executed" warnings to test failures.

On a side note:
Excluded Tests are test that are individually excluded from a test run for whatever reason. The state is remembered even after you disable and re-enable a test class, test suite or test project. In console output they will be marked with an 'x' symbol. In the GUI treeview the test will have a red X symbol.

Regards,
- Graeme -

Reply by email

Michael Van Canneyt
to Graeme Geldenhuys
Graeme Geldenhuys wrote 9 lines
On 16/04/13 09:40, Michael Van Canneyt wrote: > > I understand, but then I'd be stuck with lots of useless warnings, > since there is no way to differentiate a real from a false one. > > Better no warnings than lots of false warnings. I don't understand you statement. What false warnings? The test didn't actually do any checks - so shouldn't be considered a valid test case.

You didn't look at my example very careful.

I give it in simplified form:

Procedure TTestSomething.MyTest;
begin
   If (MyObject.MyProperty'') then
     Fail('MyProperty must be empty');
end;

For a string, you would probably use AssertEquals, but there are lots of cases where you cannot use AssertEquals, as there is nothing to be equal to.

The above kind of construct tests all it needs to test, yet does not call AssertEquals.

Since no AssertEquals is called, it will give a false warning in your test framework.

Michael.

Reply by email