Sign in Join

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

Mailing lists / fpc-pascal / 2012-01

FPCUnit without Lazarus

16 messages · 8 people · –

Reply by email Subscribe to this list Your subscription

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

Luciano de Souza

Hello listers,

I have really appreciated the organized tests that FPCUnit allows. It's really a very good feature, but for me, it hasn't been to use it.

For some while, I have writen an e-mail saying I could not run some example. The problem was that I don't use Lazarus, but only FPC. I am blind, so for me LCL doesn't make sense.

In spite of that, I had to instal Lazarus because FPCUnit has a LCL dependence.

I would like to use FPCUnit without install Lazarus, but perhaps it was not possible. If I bring FPCUnits modules to my folder, they require other modules and the other modules seem to require more modules. Without Lazarus installed, I could not run it.

The problem has become more severe becouse my Windows has failed. As I have Ubuntu 10.10, I decided to install everything here. FPC was installed, but Lazarus... I have problems of broken packages. I try to install with apt-get, but the repository has an old version only compatible with FPC 2.4.0.

I have downloaded a Lazarus deb package compatible with FPC 2.4.4. I try to install with: "sudo dpkg -i *". It fails, so: "sudo apt-get install -f".

Well, I could not install it. But, I would really prefer not to install Lazarus.

So I want an advice. As FPCUnit has no visual components, I could not understand why LCL units are required. But the important is:

How to run FPCUnit without Lazarus? Is it possible?

Regards,

Luciano

Reply by email

leledumbo
to Luciano de Souza

FPCUnit is part of FCL and it doesn't require LCL. Of course if you install via packages under Lazarus components folder, it would depend on Lazarus parts (e.g, LCL), esp. for the runner. Open
fpc/packages/fcl-fpcunit/src/demo for a pure FPC example. Or http://free-pascal-general.1045716.n5.nabble.com/file/n5128730/fpcunit.pdf here for the documentation.

View this message in context: http://free-pascal-general.1045716.n5.nabble.com/FPCUnit-without-Lazarus-tp5128696p5128730.html Sent from the Free Pascal - General mailing list .

Reply by email

Luciano de Souza
to leledumbo: FPCUnit is part of FCL and it doesn't require LCL. Of course if you install via packages…

Now, I understand. FPCUnit and FPCRegistry do not have LCL dependences. What depends on LCL is the runner called Console Runner. This name make me confused!

I ahve alredy read the documentation, but I could not understand. Perhaps, perhaps my weak english... Well, the fact is that everything is now OK.

When I read the documentation I didn't understand the runner was a separated executable: an application built specially to test my program.

I thought all the code needed to test my program would be in my test unit. I was able to create, to register the tests, but not to run then. I was searching something to run in FPCUnit and FPCRegister. All the code required to run my test would be in the initialization of my test unit. When compiling my application I would do:

program MyApp;
uses
MyUnit,
{$ifdef tst}
MyUnitTest;
{$endif}

And I call: fpc MyApp.pas -dtest. According to this idea, the runner would be my own application called with certain commandline options.

Yes, in my first reading, I do not understand it. Now I can see the adopted model is best. I don't need to mix the code of my application with test code. "{$ifdef ...}" is not required.

In brief, all my problem was that I could understand that I have a runner and I will need to compile it each time I create a new project.

Solved my interpretation issues, now I am coming back to the tests.

Thank you very much for the attention!

Regards,

Luciano

leledumbo wrote 13 lines
FPCUnit is part of FCL and it doesn't require LCL. Of course if you install via packages under Lazarus components folder, it would depend on Lazarus parts (e.g, LCL), esp. for the runner. Open fpc/packages/fcl-fpcunit/src/demo for a pure FPC example. Or http://free-pascal-general.1045716.n5.nabble.com/file/n5128730/fpcunit.pdf here for the documentation. -- View this message in context: http://free-pascal-general.1045716.n5.nabble.com/FPCUnit-without-Lazarus-tp5128696p5128730.html Sent from the Free Pascal - General mailing list . _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply by email

Luciano de Souza
to Rainer Stratmann: This was already some time discussed here and in my opinion this is the bottleneck of…

Perhaps, the issue has no a happy end for all, but for me, that don't use Lazarus and I won't have to do it due FPCUnit, everything is fortunatelly OK. It would be unconfortable to install many megabytes to use almost nothing. Now, I am happy with Freepascal. In the future, it's not impossible that I need FileUtils and Clipboard. But When it comes, I will think about. Until there, FPC is complete for me.

Rainer Stratmann wrote 11 lines
Am Sunday 08 January 2012 02:17:29 schrieb Luciano de Souza: > I have downloaded a Lazarus deb package compatible with FPC 2.4.4. I try > to install with: "sudo dpkg -i *". It fails, so: "sudo apt-get install -f". > ... > ... > ... This was already some time discussed here and in my opinion this is the bottleneck of working with freepascal on linux. _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply by email

Marco van de Voort
to Luciano de Souza: Now, I understand. FPCUnit and FPCRegistry do not have LCL dependences. What depends on…

In our previous episode, Luciano de Souza said:

Now, I understand. FPCUnit and FPCRegistry do not have LCL dependences. What depends on LCL is the runner called Console Runner. This name make me confused!

In package/fcl-fpcunit/src/demo/consolerunner

there is a runner that is not LCL dependent?

If you go there and do a

fpc -Fu../../exampletests testrunner

it will compile.

Reply by email

Sven Barth
to Luciano de Souza: Now, I understand. FPCUnit and FPCRegistry do not have LCL dependences. What depends on…

The unit consoletestrunner from $lazarusdir/components/fpcunit/console might still be useful to you, because it allows writting the testresults to the console. The unit has NO dependencies to the LCL, so you can simply copy it and compile it along with your tests. Normally you use it like this (I have not tested it and thus I'm just guessing based on the unit's code):

program mytestrunner;

uses
consoletestrunner, // this is the unit copied from Lazarus testunit1, // these are your test units

   testunit2;
begin
   with TTestRunner.Create do
     try
       Run;
     finally
       Free;
     end;
end;

Your tests then register themselves to the testsuite in the initialization section of their unit.

Regards,
Sven

Luciano de Souza wrote 64 lines
Now, I understand. FPCUnit and FPCRegistry do not have LCL dependences. What depends on LCL is the runner called Console Runner. This name make me confused! I ahve alredy read the documentation, but I could not understand. Perhaps, perhaps my weak english... Well, the fact is that everything is now OK. When I read the documentation I didn't understand the runner was a separated executable: an application built specially to test my program. I thought all the code needed to test my program would be in my test unit. I was able to create, to register the tests, but not to run then. I was searching something to run in FPCUnit and FPCRegister. All the code required to run my test would be in the initialization of my test unit. When compiling my application I would do: program MyApp; uses MyUnit, {$ifdef tst} MyUnitTest; {$endif} And I call: fpc MyApp.pas -dtest. According to this idea, the runner would be my own application called with certain commandline options. Yes, in my first reading, I do not understand it. Now I can see the adopted model is best. I don't need to mix the code of my application with test code. "{$ifdef ...}" is not required. In brief, all my problem was that I could understand that I have a runner and I will need to compile it each time I create a new project. Solved my interpretation issues, now I am coming back to the tests. Thank you very much for the attention! Regards, Luciano Em 08-01-2012 00:14, leledumbo escreveu: > FPCUnit is part of FCL and it doesn't require LCL. Of course if you > install > via packages under Lazarus components folder, it would depend on Lazarus > parts (e.g, LCL), esp. for the runner. Open > fpc/packages/fcl-fpcunit/src/demo for a pure FPC example. Or > http://free-pascal-general.1045716.n5.nabble.com/file/n5128730/fpcunit.pdf > > here for the documentation. > > -- > View this message in context: > http://free-pascal-general.1045716.n5.nabble.com/FPCUnit-without-Lazarus-tp5128696p5128730.html > > Sent from the Free Pascal - General mailing list . > _______________________________________________ > fpc-pascal maillist - > http://lists.freepascal.org/mailman/listinfo/fpc-pascal _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply by email

Sven Barth
to Rainer Stratmann: This was already some time discussed here and in my opinion this is the bottleneck of…
Rainer Stratmann wrote 12 lines
Am Sunday 08 January 2012 02:17:29 schrieb Luciano de Souza: > I have downloaded a Lazarus deb package compatible with FPC 2.4.4. I try > to install with: "sudo dpkg -i *". It fails, so: "sudo apt-get install -f". > ... > ... > ... This was already some time discussed here and in my opinion this is the bottleneck of working with freepascal on linux.

This is why I don't use the packages provided by my distribution (though I just noticed that ArchLinux already provides 2.6.0 :) ), but install them manually either by the *.tar installer provided with each release or through "make install" if I'm working with a dev version. And I also have a nice system to switch between versions easily ;)

Regards,
Sven

Reply by email

Rainer Stratmann
to Sven Barth
Sven Barth wrote 27 lines
On 08.01.2012 13:06, Rainer Stratmann wrote: > Am Sunday 08 January 2012 02:17:29 schrieb Luciano de Souza: >> I have downloaded a Lazarus deb package compatible with FPC 2.4.4. I try >> to install with: "sudo dpkg -i *". It fails, so: "sudo apt-get install >> -f". >> >> ... >> >> ... >> >> ... > > This was already some time discussed here and in my opinion this is the > bottleneck of working with freepascal on linux. This is why I don't use the packages provided by my distribution (though I just noticed that ArchLinux already provides 2.6.0 :) ), but install them manually either by the *.tar installer provided with each release or through "make install" if I'm working with a dev version. And I also have a nice system to switch between versions easily ;) Regards, Sven _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal

I tried ArchLinux, but stopped when this distribution wants to be configured manually. User-friendlyness is also the bottleneck of Linux.

Reply by email

Sven Barth
to Rainer Stratmann
Rainer Stratmann wrote 31 lines
Am Sunday 08 January 2012 13:35:49 schrieb Sven Barth: > On 08.01.2012 13:06, Rainer Stratmann wrote: >> Am Sunday 08 January 2012 02:17:29 schrieb Luciano de Souza: >>> I have downloaded a Lazarus deb package compatible with FPC 2.4.4. I try >>> to install with: "sudo dpkg -i *". It fails, so: "sudo apt-get install >>> -f". >>> >>> ... >>> >>> ... >>> >>> ... >> >> This was already some time discussed here and in my opinion this is the >> bottleneck of working with freepascal on linux. > > This is why I don't use the packages provided by my distribution (though > I just noticed that ArchLinux already provides 2.6.0 :) ), but install > them manually either by the *.tar installer provided with each release > or through "make install" if I'm working with a dev version. And I also > have a nice system to switch between versions easily ;) > > Regards, > Sven > > _______________________________________________ > fpc-pascal maillist - > http://lists.freepascal.org/mailman/listinfo/fpc-pascal I tried ArchLinux, but stopped when this distribution wants to be configured manually. User-friendlyness is also the bottleneck of Linux.

I personally prefer this "manual configuration" to that provided by distros like Ubuntu and such. My nearly 7 year old laptop runs much faster with Arch than it did with Kubuntu (which was my first Linux distro I fully used) as only those applications, services etc are running that I truly need (and I don't use any desktop manager, only a slim window manager ^^)

Regards,
Sven

Reply by email

Michael Van Canneyt
to Luciano de Souza: I have really appreciated the organized tests that FPCUnit allows. It's really a very…

Hello,

After your previous mails about this, I have discussed this with Vincent Snijders, the author of the console runner class. The console runner class of the LCL does not really have any dependencies on the LCL, only on FCL.

So, it will be moved to the FCL, Vincent has agreed to this. You must simply give me some time to actually do this move.

So please, patience, it will be done, and you will not need Lazarus.

Michael.

Luciano de Souza wrote 40 lines
Hello listers, I have really appreciated the organized tests that FPCUnit allows. It's really a very good feature, but for me, it hasn't been to use it. For some while, I have writen an e-mail saying I could not run some example. The problem was that I don't use Lazarus, but only FPC. I am blind, so for me LCL doesn't make sense. In spite of that, I had to instal Lazarus because FPCUnit has a LCL dependence. I would like to use FPCUnit without install Lazarus, but perhaps it was not possible. If I bring FPCUnits modules to my folder, they require other modules and the other modules seem to require more modules. Without Lazarus installed, I could not run it. The problem has become more severe becouse my Windows has failed. As I have Ubuntu 10.10, I decided to install everything here. FPC was installed, but Lazarus... I have problems of broken packages. I try to install with apt-get, but the repository has an old version only compatible with FPC 2.4.0. I have downloaded a Lazarus deb package compatible with FPC 2.4.4. I try to install with: "sudo dpkg -i *". It fails, so: "sudo apt-get install -f". Well, I could not install it. But, I would really prefer not to install Lazarus. So I want an advice. As FPCUnit has no visual components, I could not understand why LCL units are required. But the important is: How to run FPCUnit without Lazarus? Is it possible? Regards, Luciano _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply by email

Michael Van Canneyt
to Michael Van Canneyt

Follow-up:

I moved consoletestrunner unit to fcl. Revision 20010.

Michael.

Michael Van Canneyt wrote 62 lines
Hello, After your previous mails about this, I have discussed this with Vincent Snijders, the author of the console runner class. The console runner class of the LCL does not really have any dependencies on the LCL, only on FCL. So, it will be moved to the FCL, Vincent has agreed to this. You must simply give me some time to actually do this move. So please, patience, it will be done, and you will not need Lazarus. Michael. On Sat, 7 Jan 2012, Luciano de Souza wrote: > Hello listers, > > I have really appreciated the organized tests that FPCUnit allows. It's > really a very good feature, but for me, it hasn't been to use it. > > For some while, I have writen an e-mail saying I could not run some > example. The problem was that I don't use Lazarus, but only FPC. I am > blind, so for me LCL doesn't make sense. > > In spite of that, I had to instal Lazarus because FPCUnit has a LCL > dependence. > > I would like to use FPCUnit without install Lazarus, but perhaps it was not > possible. If I bring FPCUnits modules to my folder, they require other > modules and the other modules seem to require more modules. Without Lazarus > installed, I could not run it. > > The problem has become more severe becouse my Windows has failed. As I have > Ubuntu 10.10, I decided to install everything here. FPC was installed, but > Lazarus... I have problems of broken packages. I try to install with > apt-get, but the repository has an old version only compatible with FPC > 2.4.0. > > I have downloaded a Lazarus deb package compatible with FPC 2.4.4. I try to > install with: "sudo dpkg -i *". It fails, so: "sudo apt-get install -f". > > Well, I could not install it. But, I would really prefer not to install > Lazarus. > > So I want an advice. As FPCUnit has no visual components, I could not > understand why LCL units are required. But the important is: > > How to run FPCUnit without Lazarus? Is it possible? > > Regards, > > Luciano > _______________________________________________ > fpc-pascal maillist - > http://lists.freepascal.org/mailman/listinfo/fpc-pascal > _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply by email

Luciano de Souza
to Michael Van Canneyt: Follow-up: I moved consoletestrunner unit to fcl. Revision 20010. Michael.

Michael,

In a exemple folder ConsoleRunner inside FPC, I found something like TestRunner.pp. It's something like the ConsoleRunner of Lazarus Components. I added my unit in this application and after compiling, I could run my tests.

I am really entusiastic with FPCUnit. It's really easy to create my tests. But being everything in FPC, it would be better, becouse after installling FPC, the feature is ready to use. I am using the application runner, not the unit ConsoleRunner, but, it's enough to run everything.

Thank you for the attention and congratulations for your work.

Regards,

Luciano

Michael Van Canneyt wrote 77 lines
Follow-up: I moved consoletestrunner unit to fcl. Revision 20010. Michael. On Sun, 8 Jan 2012, Michael Van Canneyt wrote: > > Hello, > > After your previous mails about this, I have discussed this with > Vincent Snijders, the author of the console runner class. The console > runner class of the LCL does not really have any dependencies on the > LCL, only on FCL. > > So, it will be moved to the FCL, Vincent has agreed to this. > You must simply give me some time to actually do this move. > > So please, patience, it will be done, and you will not need Lazarus. > > Michael. > > > On Sat, 7 Jan 2012, Luciano de Souza wrote: > >> Hello listers, >> >> I have really appreciated the organized tests that FPCUnit allows. >> It's really a very good feature, but for me, it hasn't been to >> use it. >> >> For some while, I have writen an e-mail saying I could not run some >> example. The problem was that I don't use Lazarus, but only FPC. I >> am blind, so for me LCL doesn't make sense. >> >> In spite of that, I had to instal Lazarus because FPCUnit has a LCL >> dependence. >> >> I would like to use FPCUnit without install Lazarus, but perhaps it >> was not possible. If I bring FPCUnits modules to my folder, they >> require other modules and the other modules seem to require more >> modules. Without Lazarus installed, I could not run it. >> >> The problem has become more severe becouse my Windows has failed. As >> I have Ubuntu 10.10, I decided to install everything here. FPC was >> installed, but Lazarus... I have problems of broken packages. I try >> to install with apt-get, but the repository has an old version only >> compatible with FPC 2.4.0. >> >> I have downloaded a Lazarus deb package compatible with FPC 2.4.4. I >> try to install with: "sudo dpkg -i *". It fails, so: "sudo apt-get >> install -f". >> >> Well, I could not install it. But, I would really prefer not to >> install Lazarus. >> >> So I want an advice. As FPCUnit has no visual components, I could >> not understand why LCL units are required. But the important is: >> >> How to run FPCUnit without Lazarus? Is it possible? >> >> Regards, >> >> Luciano >> _______________________________________________ >> fpc-pascal maillist - >> http://lists.freepascal.org/mailman/listinfo/fpc-pascal >> > _______________________________________________ > fpc-pascal maillist - > http://lists.freepascal.org/mailman/listinfo/fpc-pascal > _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply by email

Graeme Geldenhuys
to Michael Van Canneyt: After your previous mails about this, I have discussed this with Vincent Snijders, the…
Michael Van Canneyt wrote 6 lines
After your previous mails about this, I have discussed this with Vincent Snijders, the author of the console runner class. The console runner class of the LCL does not really have any dependencies on the LCL, only on FCL. From memory, it depended on some UTF-8 method for parameter handling -

included in LCL. But seeing that you moved the console runner into FCL already, you probably fixed anyways, so my comment is moot. ;-)

Regards,   - Graeme - _______________________________________________ fpGUI - a cross-platform Free Pascal GUI toolkit http://fpgui.sourceforge.net

Reply by email

Unknown author
to Graeme Geldenhuys
Graeme Geldenhuys wrote 9 lines
On 8 January 2012 17:23, Michael Van Canneyt wrote: > > After your previous mails about this, I have discussed this with Vincent > Snijders, the author of the console runner class. The console runner class > of the LCL does not really have any dependencies on the LCL, only on FCL. > From memory, it depended on some UTF-8 method for parameter handling - included in LCL. But seeing that you moved the console runner into FCL already, you probably fixed anyways, so my comment is moot. ;-)

Correct. Since the windows console normally is not UTF-8, this change has no ill effects anyway.

Michael.

Reply by email