comp.lang.ada
 help / color / mirror / Atom feed
* AUnit Examples Fail
@ 2010-08-15  3:16 R.B. Love
  2010-08-15  4:34 ` Yannick Duchêne (Hibou57)
  0 siblings, 1 reply; 4+ messages in thread
From: R.B. Love @ 2010-08-15  3:16 UTC (permalink / raw)


All the talk about AUnit made me think I should be doing automatic unit 
testing.  I grabbed a fresh copy of GPL 2010 Gnat along with the AUnit 
module.   The install of Gnat went fine.   I think  the install of 
AUnit went fine.   I went into the aunit/test directory and the make 
seemed to go well and reported.

Then I go aunit-gpl-2010-src/examples/simple_test and type make.  I get this:

bash-3.2$ make
gprbuild -p -Pharness/harness
object directory 
"/home/rlove/SW_Tools/AUnit/aunit-gpl-2010-src/examples/simple_test/harness/obj" 
created
object directory 
"/home/rlove/SW_Tools/AUnit/aunit-gpl-2010-src/examples/simple_test/tested_lib/obj" 
created for project testlib
library directory 
"/home/rlove/SW_Tools/AUnit/aunit-gpl-2010-src/examples/simple_test/tested_lib/lib" 
created for project testlib
gcc -c -g -gnatQ -O1 -gnatf -gnato -gnatwa.Xe -gnaty -gnat05 test_math.adb
gcc -c -g -O1 -gnat05 -gnatwa.Xe -gnaty -gnata -gnatf math.adb
gcc -c -g -gnatQ -O1 -gnatf -gnato -gnatwa.Xe -gnaty -gnat05 math_suite.adb
gcc -c -g -gnatQ -O1 -gnatf -gnato -gnatwa.Xe -gnaty -gnat05 math-test.adb
math-test.adb:19:07: warning: call to obsolescent procedure "Assert" 
declared at  aunit-assertions.ads:113
math-test.adb:20:07: warning: call to obsolescent procedure "Assert" 
declared at  aunit-assertions.ads:113
gprbuild: *** compilation phase failed
make: *** [all] Error 4


I get the same result in any of the Examples directories.   This was on 
my CentOS machine.  I get the same results when I do this on a Mac.

I was hoping the examples would work out of  the box and serve as well, 
examples.

Thanks for any pointers on how to make this work.






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

* Re: AUnit Examples Fail
  2010-08-15  3:16 AUnit Examples Fail R.B. Love
@ 2010-08-15  4:34 ` Yannick Duchêne (Hibou57)
  2010-08-15 12:00   ` Simon Wright
  0 siblings, 1 reply; 4+ messages in thread
From: Yannick Duchêne (Hibou57) @ 2010-08-15  4:34 UTC (permalink / raw)


Le Sun, 15 Aug 2010 05:16:03 +0200, R.B. Love <rblove@airmail.net> a écrit:
> math-test.adb:20:07: warning: call to obsolescent procedure "Assert"  
> declared at  aunit-assertions.ads:113
> gprbuild: *** compilation phase failed
> make: *** [all] Error 4
This is a GNAT 2010 issue. Open the GPR files and change any “-gnatwe” you  
see into “-gnatw” and any “-gnatw.Xe” into “-gnatw.X”.

Basically, the project files were configured so that all warnings are  
treated as error. As you see, there are warnings during the build process.  
As this warnings are treated as error, this ends up in a failed  
compilation process.

Turning “-gnatwe” into “-gnatw” as an example, you will turn off the  
option “Treat Warnings as Errors”.

This should solve the trick.

Probably the example cases makes some reference to some source using  
obsolescent feature and the source in the example cases were not updated.

-- 
There is even better than a pragma Assert: a SPARK --# check.
--# check C and WhoKnowWhat and YouKnowWho;
--# assert Ada;
--  i.e. forget about previous premises which leads to conclusion
--  and start with new conclusion as premise.



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

* Re: AUnit Examples Fail
  2010-08-15  4:34 ` Yannick Duchêne (Hibou57)
@ 2010-08-15 12:00   ` Simon Wright
  2010-08-15 13:54     ` Yannick Duchêne (Hibou57)
  0 siblings, 1 reply; 4+ messages in thread
From: Simon Wright @ 2010-08-15 12:00 UTC (permalink / raw)


"Yannick Duchêne (Hibou57)" <yannick_duchene@yahoo.fr> writes:

> This is a GNAT 2010 issue. Open the GPR files and change any “-gnatwe”
> you see into “-gnatw” and any “-gnatw.Xe” into “-gnatw.X”.

I'd have thought you needed to just delete them?

I don't know what -gnatw.Xe means, gnatmake -h says "turn off warnings
for non-local exception"!



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

* Re: AUnit Examples Fail
  2010-08-15 12:00   ` Simon Wright
@ 2010-08-15 13:54     ` Yannick Duchêne (Hibou57)
  0 siblings, 0 replies; 4+ messages in thread
From: Yannick Duchêne (Hibou57) @ 2010-08-15 13:54 UTC (permalink / raw)


Le Sun, 15 Aug 2010 14:00:28 +0200, Simon Wright <simon@pushface.org> a  
écrit:
> I'd have thought you needed to just delete them?
I wanted to change the less as possible, to be safe

> I don't know what -gnatw.Xe means, gnatmake -h says "turn off warnings
> for non-local exception"!
Me neither. I just know -gnatwa and -gnatwe. By the way I was wrong in the  
previous post, as I wrote -gnatwe and -gnatw instead of -gnatwae and  
-gnatwa (forget the "a"). It seems you can add multiple flags in the same  
place, like -gnatwae do: it has both the "All" and "as Error" flag. There  
is also an .X and an .x for warnings about non-local exceptions. Just  
guess the "e" appended to it means "as Error" as well.



-- 
There is even better than a pragma Assert: a SPARK --# check.
--# check C and WhoKnowWhat and YouKnowWho;
--# assert Ada;
--  i.e. forget about previous premises which leads to conclusion
--  and start with new conclusion as premise.



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

end of thread, other threads:[~2010-08-15 13:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-15  3:16 AUnit Examples Fail R.B. Love
2010-08-15  4:34 ` Yannick Duchêne (Hibou57)
2010-08-15 12:00   ` Simon Wright
2010-08-15 13:54     ` Yannick Duchêne (Hibou57)

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