comp.lang.ada
 help / color / mirror / Atom feed
* Installing AUnit
@ 2009-03-16 16:10 Tim Rowe
  2009-03-17 10:47 ` Peter C. Chapin
  0 siblings, 1 reply; 15+ messages in thread
From: Tim Rowe @ 2009-03-16 16:10 UTC (permalink / raw)


I'm trying to install AUnit. I've downloaded the sources, run 
doinstall.bat, accepted all the defaults and -- now what?

The test code I'm developing falls over at:
with Aunit.Test_Cases;
because it can't find aunit.ads. Fair enough, I need to make it 
available, but searching my system I find I now have 3 files called 
aunit.ads, in c:\program files\GNAT\2008\share\examples\aunit, 
c:\program files\GNAT\2008\share\gps\aunit-2.03-src\template and in 
c:\program files\GNAT\2008\share\gps\aunit-2.03-src\test\src. None of 
those looks a very likely contender for the one I should make available 
-- which one should it be? (And how do I do that in AdaGIDE?)

Thanks in advance!



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Installing AUnit
  2009-03-16 16:10 Installing AUnit Tim Rowe
@ 2009-03-17 10:47 ` Peter C. Chapin
  2009-03-18 17:48   ` sjw
  2009-03-19  0:46   ` Tim Rowe
  0 siblings, 2 replies; 15+ messages in thread
From: Peter C. Chapin @ 2009-03-17 10:47 UTC (permalink / raw)


Tim Rowe <spamtrap@tgrowe.plus.net> wrote in 
news:m_KdnXGtYsdx5CPUnZ2dnUVZ8jyWnZ2d@posted.plusnet:

> I'm trying to install AUnit. I've downloaded the sources, run 
> doinstall.bat, accepted all the defaults and -- now what?
> 
> The test code I'm developing falls over at:
> with Aunit.Test_Cases;
> because it can't find aunit.ads. Fair enough, I need to make it 
> available, but searching my system...

You have to create your own aunit.ads. Its an instantation of 
AUnit_Framework.Framework that is customized to your situation. For 
example, in one of my projects I'm using this:

pragma Restrictions (No_Implicit_Dynamic_Code);
with AUnit_Framework.Framework;
package AUnit is new AUnit_Framework.Framework
  (Max_Exceptions_Per_Harness   => 5,
   Max_Failures_Per_Harness     => 20,
   Max_Routines_Per_Test_Case   => 50,
   Max_Test_Cases_Per_Suite     => 50);

The aunit.ads file is a source file in my project.

Peter



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Installing AUnit
  2009-03-17 10:47 ` Peter C. Chapin
@ 2009-03-18 17:48   ` sjw
  2009-03-19  0:28     ` Tim Rowe
  2009-03-19  0:46   ` Tim Rowe
  1 sibling, 1 reply; 15+ messages in thread
From: sjw @ 2009-03-18 17:48 UTC (permalink / raw)


On Mar 17, 10:47 am, "Peter C. Chapin" <pcc482...@gmail.com> wrote:
> Tim Rowe <spamt...@tgrowe.plus.net> wrote innews:m_KdnXGtYsdx5CPUnZ2dnUVZ8jyWnZ2d@posted.plusnet:
>
> > I'm trying to install AUnit. I've downloaded the sources, run
> > doinstall.bat, accepted all the defaults and -- now what?
>
> > The test code I'm developing falls over at:
> > with Aunit.Test_Cases;
> > because it can't find aunit.ads. Fair enough, I need to make it
> > available, but searching my system...
>
> You have to create your own aunit.ads. Its an instantation of
> AUnit_Framework.Framework that is customized to your situation. For
> example, in one of my projects I'm using this:

I'm pretty sure this is AUnit 2 (which I never used, simply because it
seemed so much less easy to use than AUnit 1).

AUnit 3 seems to give the best of both worlds & I'd recommend it, if
only because my old test code built with only minor changes! (looks as
though I got it from the AdaCore subversion server -
http://svn.eu.adacore.com/anonsvn/US/trunk/AUnit).

It will be more complex with AdaGIDE than with GPRs. That said, the
code is findable via the AUnit GPRs with a bit of detection.

I'm a bit surprised at the locations of the various aunit.ads fines,
though. Might be worth reading doinstall.bat to see what it does.



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Installing AUnit
  2009-03-18 17:48   ` sjw
@ 2009-03-19  0:28     ` Tim Rowe
  0 siblings, 0 replies; 15+ messages in thread
From: Tim Rowe @ 2009-03-19  0:28 UTC (permalink / raw)


sjw wrote:

> It will be more complex with AdaGIDE than with GPRs.

GPRs?

> Might be worth reading doinstall.bat to see what it does.

Reverse engineer an MS-DOS batch file? Eep!



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Installing AUnit
  2009-03-17 10:47 ` Peter C. Chapin
  2009-03-18 17:48   ` sjw
@ 2009-03-19  0:46   ` Tim Rowe
  2009-03-19 10:26     ` Peter C. Chapin
  1 sibling, 1 reply; 15+ messages in thread
From: Tim Rowe @ 2009-03-19  0:46 UTC (permalink / raw)


Peter C. Chapin wrote:

> package AUnit is new AUnit_Framework.Framework

Trouble is, the only AUnit_Framework.ads and 
AUnit_Framework-Framework.ads files on my computer are in the sources 
directory. It does seem to be an installation issue :-(

So, from the top, what should I download? I got aunit-2.03.src.tgz from 
https://libre.adacore.com/dynamic/download_page, but from what sjw says 
there are other versions.



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Installing AUnit
  2009-03-19  0:46   ` Tim Rowe
@ 2009-03-19 10:26     ` Peter C. Chapin
  2009-03-19 11:52       ` Tim Rowe
  2009-03-23 15:34       ` Tim Rowe
  0 siblings, 2 replies; 15+ messages in thread
From: Peter C. Chapin @ 2009-03-19 10:26 UTC (permalink / raw)


Tim Rowe <spamtrap@tgrowe.plus.net> wrote in 
news:BZKdncNqxrhhCFzUnZ2dnUVZ8vyWnZ2d@posted.plusnet:

> Trouble is, the only AUnit_Framework.ads and 
> AUnit_Framework-Framework.ads files on my computer are in the sources 
> directory. It does seem to be an installation issue :-(

When I did the installation The AUnit material got placed under my GNAT 
installation tree. This was a while ago now so I forget the details. 
However, the package specifications got put under the include folder and 
the compiled library got put under the lib folder. Here I'm talking 
about

    	C:\GNAT\2008\include\aunit
    	C:\GNAT\2008\lib\aunit

The aunit.gpr file ends up in

    	C:\GNAT\2008\lib\gnat

This arrangement was all done by the installer as I recall. I certainly 
don't remember moving things into these places manually. The advantage 
of this is that one can simply include

    	with "aunit.gpr";

in any project file that needs to use AUnit and GNAT auto-magically 
finds what it needs without having to play with the ADA_PROJECT_PATH 
evironment variable.

Peter



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Installing AUnit
  2009-03-19 10:26     ` Peter C. Chapin
@ 2009-03-19 11:52       ` Tim Rowe
  2009-03-19 12:08         ` Martin
  2009-03-23 15:34       ` Tim Rowe
  1 sibling, 1 reply; 15+ messages in thread
From: Tim Rowe @ 2009-03-19 11:52 UTC (permalink / raw)


Peter C. Chapin wrote:
> of this is that one can simply include
> 
>     	with "aunit.gpr";
> 
> in any project file that needs to use AUnit and GNAT auto-magically 
> finds what it needs without having to play with the ADA_PROJECT_PATH 
> evironment variable.

What do you mean by a project file in this context? That doesn't seem to 
be legal syntax within an Ada specification file.



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Installing AUnit
  2009-03-19 11:52       ` Tim Rowe
@ 2009-03-19 12:08         ` Martin
  2009-03-19 13:17           ` Ludovic Brenta
  2009-03-19 15:46           ` Tim Rowe
  0 siblings, 2 replies; 15+ messages in thread
From: Martin @ 2009-03-19 12:08 UTC (permalink / raw)


On Mar 19, 11:52 am, Tim Rowe <spamt...@tgrowe.plus.net> wrote:
> Peter C. Chapin wrote:
> > of this is that one can simply include
>
> >            with "aunit.gpr";
>
> > in any project file that needs to use AUnit and GNAT auto-magically
> > finds what it needs without having to play with the ADA_PROJECT_PATH
> > evironment variable.
>
> What do you mean by a project file in this context? That doesn't seem to
> be legal syntax within an Ada specification file.

A GPS project file (GNAT Programming Studio) - Google "libre gnat gps"

Cheers
-- Martin



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Installing AUnit
  2009-03-19 12:08         ` Martin
@ 2009-03-19 13:17           ` Ludovic Brenta
  2009-03-19 19:43             ` Martin
  2009-03-19 15:46           ` Tim Rowe
  1 sibling, 1 reply; 15+ messages in thread
From: Ludovic Brenta @ 2009-03-19 13:17 UTC (permalink / raw)


Martin wrote on comp.lang.ada:
> On Mar 19, 11:52 am, Tim Rowe <spamt...@tgrowe.plus.net> wrote:
>
> > Peter C. Chapin wrote:
> > > of this is that one can simply include
>
> > >            with "aunit.gpr";
>
> > > in any project file that needs to use AUnit and GNAT auto-magically
> > > finds what it needs without having to play with the ADA_PROJECT_PATH
> > > evironment variable.
>
> > What do you mean by a project file in this context? That doesn't seem to
> > be legal syntax within an Ada specification file.
>
> A GPS project file (GNAT Programming Studio) - Google "libre gnat gps"

Actually a GNAT project file, supported by gnatmake since at least
3.15p i.e. before GPS even existed. Described in detail in the chapter
"GNAT Project Manager" of the GNAT User's Guide.

--
Ludovic Brenta.



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Installing AUnit
  2009-03-19 12:08         ` Martin
  2009-03-19 13:17           ` Ludovic Brenta
@ 2009-03-19 15:46           ` Tim Rowe
  1 sibling, 0 replies; 15+ messages in thread
From: Tim Rowe @ 2009-03-19 15:46 UTC (permalink / raw)


Martin wrote:

> A GPS project file (GNAT Programming Studio) - Google "libre gnat gps"

Ok -- I was using AdaGIDE, but I can't find anything in its help about 
project files so perhaps I should switch to GPS; I already have it 
installed.



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Installing AUnit
  2009-03-19 13:17           ` Ludovic Brenta
@ 2009-03-19 19:43             ` Martin
  0 siblings, 0 replies; 15+ messages in thread
From: Martin @ 2009-03-19 19:43 UTC (permalink / raw)


On Mar 19, 1:17 pm, Ludovic Brenta <ludo...@ludovic-brenta.org> wrote:
> Actually a GNAT project file, supported by gnatmake since at least
> 3.15p i.e. before GPS even existed. Described in detail in the chapter
> "GNAT Project Manager" of the GNAT User's Guide.

Guess I'm just too GPS-centric now! :-)

Cheers
-- Martin



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Installing AUnit
  2009-03-19 10:26     ` Peter C. Chapin
  2009-03-19 11:52       ` Tim Rowe
@ 2009-03-23 15:34       ` Tim Rowe
  2009-03-27 10:31         ` Peter C. Chapin
  1 sibling, 1 reply; 15+ messages in thread
From: Tim Rowe @ 2009-03-23 15:34 UTC (permalink / raw)


Peter C. Chapin wrote:

> This arrangement was all done by the installer as I recall. I certainly 
> don't remember moving things into these places manually. The advantage 
> of this is that one can simply include
> 
>     	with "aunit.gpr";
> 
> in any project file that needs to use AUnit and GNAT auto-magically 
> finds what it needs without having to play with the ADA_PROJECT_PATH 
> evironment variable.

Ok, I uninstalled everything and reinstalled it all from scratch, and am 
now using GPS. Edit | Unit Testing now does useful stuff (it previously 
told me to check my GPS installation).

When you tell me to include
	with "aunit.gpr";
you presumably don't mean just type it into the project file? Because 
when I do that it seems to work, but it gets overwritten when I change 
the project file through the project settings dialog. Presumably it's 
equivalent to something in the project settings dialog?



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Installing AUnit
  2009-03-23 15:34       ` Tim Rowe
@ 2009-03-27 10:31         ` Peter C. Chapin
  2009-03-27 11:36           ` Tim Rowe
  2009-03-27 19:55           ` sjw
  0 siblings, 2 replies; 15+ messages in thread
From: Peter C. Chapin @ 2009-03-27 10:31 UTC (permalink / raw)


Tim Rowe <spamtrap@tgrowe.plus.net> wrote in 
news:hJmdnYyEL4G2MVrUnZ2dnUVZ8tOWnZ2d@posted.plusnet:

> When you tell me to include
>      with "aunit.gpr";
> you presumably don't mean just type it into the project file? Because 
> when I do that it seems to work, but it gets overwritten when I change 
> the project file through the project settings dialog. Presumably it's 
> equivalent to something in the project settings dialog?

I've always just typed it into the project file manually. Is GPS running 
when you do that? If so I'd recommend only manually editing the project 
file while GPS is not running.

Peter



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Installing AUnit
  2009-03-27 10:31         ` Peter C. Chapin
@ 2009-03-27 11:36           ` Tim Rowe
  2009-03-27 19:55           ` sjw
  1 sibling, 0 replies; 15+ messages in thread
From: Tim Rowe @ 2009-03-27 11:36 UTC (permalink / raw)


Peter C. Chapin wrote:

> I've always just typed it into the project file manually. Is GPS running 
> when you do that? If so I'd recommend only manually editing the project 
> file while GPS is not running.

Yes, I've been doing it within GPS. I'll try editing it outside GPS. Thanks.



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Installing AUnit
  2009-03-27 10:31         ` Peter C. Chapin
  2009-03-27 11:36           ` Tim Rowe
@ 2009-03-27 19:55           ` sjw
  1 sibling, 0 replies; 15+ messages in thread
From: sjw @ 2009-03-27 19:55 UTC (permalink / raw)


On Mar 27, 10:31 am, "Peter C. Chapin" <pcc482...@gmail.com> wrote:

> I've always just typed it into the project file manually. Is GPS running
> when you do that? If so I'd recommend only manually editing the project
> file while GPS is not running.

I found that editing in GPS, saving, then (re)loading recent (on the
Project menu, I think) worked.



^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2009-03-27 19:55 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-16 16:10 Installing AUnit Tim Rowe
2009-03-17 10:47 ` Peter C. Chapin
2009-03-18 17:48   ` sjw
2009-03-19  0:28     ` Tim Rowe
2009-03-19  0:46   ` Tim Rowe
2009-03-19 10:26     ` Peter C. Chapin
2009-03-19 11:52       ` Tim Rowe
2009-03-19 12:08         ` Martin
2009-03-19 13:17           ` Ludovic Brenta
2009-03-19 19:43             ` Martin
2009-03-19 15:46           ` Tim Rowe
2009-03-23 15:34       ` Tim Rowe
2009-03-27 10:31         ` Peter C. Chapin
2009-03-27 11:36           ` Tim Rowe
2009-03-27 19:55           ` sjw

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox