comp.lang.ada
 help / color / mirror / Atom feed
* Ada-Python inter-language testing
@ 2005-01-17 12:21 Matteo Bertini
  2005-01-17 13:32 ` Martin Krischik
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Matteo Bertini @ 2005-01-17 12:21 UTC (permalink / raw)


I'm doing some coding for an Ada-Python bridge to decouple test-code 
from ada-code.

The idea is:

(A) Have some Ada code to test.

(B) Write down an Ada package exporting procedures and functions in a C 
compatible way.

(C) Write a Pyrex[1] (Python[2] like language for making C modules) 
bridge to access Ada exported procedures and functions.

(D) Write unit-testing in Python, being free to add/remove/change 
test-cases without recompiling and with a lot of introspection features.


Considering that the point (B) is error prone and time consuming, could 
ever someone in the real world need something like this?

[1] http://nz.cosc.canterbury.ac.nz/~greg/python/Pyrex/
[2] http://www.python.org

Matteo Bertini



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

* Re: Ada-Python inter-language testing
  2005-01-17 12:21 Ada-Python inter-language testing Matteo Bertini
@ 2005-01-17 13:32 ` Martin Krischik
  2005-01-17 19:11 ` Stephen Leake
  2005-01-17 21:09 ` Simon Wright
  2 siblings, 0 replies; 6+ messages in thread
From: Martin Krischik @ 2005-01-17 13:32 UTC (permalink / raw)


Matteo Bertini wrote:

> I'm doing some coding for an Ada-Python bridge to decouple test-code
> from ada-code.
> 
> The idea is:
> 
> (A) Have some Ada code to test.
> 
> (B) Write down an Ada package exporting procedures and functions in a C
> compatible way.
> 
> (C) Write a Pyrex[1] (Python[2] like language for making C modules)
> bridge to access Ada exported procedures and functions.
> 
> (D) Write unit-testing in Python, being free to add/remove/change
> test-cases without recompiling and with a lot of introspection features.
> 
> 
> Considering that the point (B) is error prone and time consuming, could
> ever someone in the real world need something like this?

Now, GPS has a Pyhon binding:

http://libre.act-europe.fr/gps/

and there is a Python/Ada Project on Sourceforge:

http://sourceforge.net/projects/pyada/

So, yes there is interest. However, the pyada project is not unmaintained
(you might want to take it over) and that shows: it ain't easy

Martin

-- 
mailto://krischik@users.sourceforge.net
http://www.ada.krischik.com



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

* Re: Ada-Python inter-language testing
  2005-01-17 12:21 Ada-Python inter-language testing Matteo Bertini
  2005-01-17 13:32 ` Martin Krischik
@ 2005-01-17 19:11 ` Stephen Leake
  2005-01-17 21:09 ` Simon Wright
  2 siblings, 0 replies; 6+ messages in thread
From: Stephen Leake @ 2005-01-17 19:11 UTC (permalink / raw)
  To: comp.lang.ada

Matteo Bertini <matteob@naufraghi.net> writes:

> I'm doing some coding for an Ada-Python bridge to decouple test-code
> from ada-code.
> 
> The idea is:
> 
> (A) Have some Ada code to test.

Yes, I have lots of that :).

> (B) Write down an Ada package exporting procedures and functions in
> a C compatible way.

Yuck. No named aggregates, no tagged types!

> (C) Write a Pyrex[1] (Python[2] like language for making C modules)
> bridge to access Ada exported procedures and functions.

If you say so. 
 
> (D) Write unit-testing in Python, being free to add/remove/change
> test-cases without recompiling and with a lot of introspection
> features.

And free to spend lots of time chasing bugs in the test framework.

If Ada is a good language for writing code, why not write (test) code
in Ada?

The "introspection" you speak of will be of no benefit; it can't see
the Ada code.

Just use AUnit. 

> Considering that the point (B) is error prone and time consuming,

Exactly.

> could ever someone in the real world need something like this?

Not from me.

-- 
-- Stephe




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

* Re: Ada-Python inter-language testing
  2005-01-17 12:21 Ada-Python inter-language testing Matteo Bertini
  2005-01-17 13:32 ` Martin Krischik
  2005-01-17 19:11 ` Stephen Leake
@ 2005-01-17 21:09 ` Simon Wright
  2005-01-18  9:15   ` Matteo Bertini
  2 siblings, 1 reply; 6+ messages in thread
From: Simon Wright @ 2005-01-17 21:09 UTC (permalink / raw)


Matteo Bertini <matteob@naufraghi.net> writes:

> I'm doing some coding for an Ada-Python bridge to decouple test-code
> from ada-code.
> 
> The idea is:
> 
> (A) Have some Ada code to test.
> 
> (B) Write down an Ada package exporting procedures and functions in a
> C compatible way.

One of us is considering CORBA (PolyORB on the Ada (GNAT) side,
omniORB on the Python side). I can see it for integration support,
but for unit testing .. I don't think so, but we shall see!

-- 
Simon Wright                               100% Ada, no bugs.



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

* Re: Ada-Python inter-language testing
  2005-01-17 21:09 ` Simon Wright
@ 2005-01-18  9:15   ` Matteo Bertini
  2005-01-18 21:37     ` Jerome Hugues
  0 siblings, 1 reply; 6+ messages in thread
From: Matteo Bertini @ 2005-01-18  9:15 UTC (permalink / raw)


oh, yes, unit-testing is there only because this is and university exam 
related work, I was thinking about integration in general!

PolyORB could be very interesting, for example it seems to support 
exception passing, and in my coding I'm finding it very hard to have.

By the way consider also ctypes[1], once exported a la C, ctypes can 
access every function in a dll with a little pure python coding (on the 
fly).

[1] http://starship.python.net/crew/theller/ctypes/

Thanks for the answers,
Matteo Bertini

Simon Wright wrote:
> One of us is considering CORBA (PolyORB on the Ada (GNAT) side,
> omniORB on the Python side). I can see it for integration support,
> but for unit testing .. I don't think so, but we shall see!



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

* Re: Ada-Python inter-language testing
  2005-01-18  9:15   ` Matteo Bertini
@ 2005-01-18 21:37     ` Jerome Hugues
  0 siblings, 0 replies; 6+ messages in thread
From: Jerome Hugues @ 2005-01-18 21:37 UTC (permalink / raw)


In article <ss4Hd.9426$fs6.227087@twister2.libero.it>, Matteo Bertini wrote:

> PolyORB could be very interesting, for example it seems to support 
> exception passing, and in my coding I'm finding it very hard to have.

PolyORB supports it as part of the CORBA or the DSA
specifications. Still, you will have to define the exception exchanged
between the two nodes CORBA/Ada and CORBA/Python (I suppose
CORBA.Unkown is not enough ;))

> Simon Wright wrote:
>> One of us is considering CORBA (PolyORB on the Ada (GNAT) side,
>> omniORB on the Python side). I can see it for integration support,
>> but for unit testing .. I don't think so, but we shall see!

AFAIK, python supports some kind of reflection, as for Java. A generic
testing framework a-la JUnit may help building various tests, all
automatic. 

PolyORB supports CORBA DSI, so there may be some way to pilot your Ada
code from a test driver written in Python. Still, this may be really
technical. 

Note that all feedback on the use of PolyORB is always welcome ;)

-- 
Jerome



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

end of thread, other threads:[~2005-01-18 21:37 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-01-17 12:21 Ada-Python inter-language testing Matteo Bertini
2005-01-17 13:32 ` Martin Krischik
2005-01-17 19:11 ` Stephen Leake
2005-01-17 21:09 ` Simon Wright
2005-01-18  9:15   ` Matteo Bertini
2005-01-18 21:37     ` Jerome Hugues

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