Command line interpreter

R

Ryan

I was wondering if anyone could lend a hand with the following issue...

I am testing application code (C++) that is currently built for the VxWorks
platform. When loading in the object code (ld < test.o), all global
definitions are automatically visible to the VxWorks command line interpreter,
meaning I can call my test functions in whatever order I like. So far so good.

Now I would like to port this code to Solaris. The problem is that when I
build an executable, there is normally no command line interpreter available
that sees the global code space of the executable. I would normally have to
re-compile every time I want my test code to call functions in a different order.

So the question is: Is there a public domain command line interpreter (C/C++)
available for linking into a Solaris executable, preferably that uses Bash
syntax? Or has anyone tried to link in bash itself?

Many thanks in advance for the feedback.
 
P

Phlip

Ryan said:
I was wondering if anyone could lend a hand with the following issue...

I am testing application code (C++) that is currently built for the VxWorks
platform. When loading in the object code (ld < test.o), all global
definitions are automatically visible to the VxWorks command line interpreter,
meaning I can call my test functions in whatever order I like. So far so good.

Now I would like to port this code to Solaris. The problem is that when I
build an executable, there is normally no command line interpreter available
that sees the global code space of the executable. I would normally have to
re-compile every time I want my test code to call functions in a different order.

So the question is: Is there a public domain command line interpreter (C/C++)
available for linking into a Solaris executable, preferably that uses Bash
syntax? Or has anyone tried to link in bash itself?

A recent thread here contained links like this:

Ioannis said:
And a very nice simple one that I just discovered on the web:

http://home.mweb.co.za/sd/sdonovan/underc.html

I really like it:

UnderC C++ Interpreter vs 1.2.9w
Steve Donovan, 2001-2003
This program is GPL'd; see LICENCE for details

program is GPL'd; see LICENCE for details
template<class T>
inline void f(T x)
{
cout<<x<<endl;
}
;>
;;
;; f(1);
1
;>

Use http://groups.google.com to seek that thread and see a few other links.

However, why are you _manually_ testing? When I use CppUnit (or, as usual
for C++, a hand-made equivalent, such as NanoCppUnit), I do what you do on a
command line; make little experiments and verify each one's results.
However, because I use a .cpp file to store all the experiments, I can run
them over and over again. I'm just curious about your intent.
 
I

Ioannis Vranos

Ryan said:
I was wondering if anyone could lend a hand with the following issue...

I am testing application code (C++) that is currently built for the
VxWorks platform. When loading in the object code (ld < test.o), all
global definitions are automatically visible to the VxWorks command line
interpreter, meaning I can call my test functions in whatever order I
like. So far so good.

Now I would like to port this code to Solaris. The problem is that when
I build an executable, there is normally no command line interpreter
available that sees the global code space of the executable. I would
normally have to re-compile every time I want my test code to call
functions in a different order.

So the question is: Is there a public domain command line interpreter
(C/C++) available for linking into a Solaris executable, preferably that
uses Bash syntax? Or has anyone tried to link in bash itself?

Many thanks in advance for the feedback.



Here are three ones:


http://home.mweb.co.za/sd/sdonovan/underc.html NEW

http://www.softintegration.com

http://root.cern.ch/root/Cint.html
 
?

=?ISO-8859-1?Q?=22Nils_O=2E_Sel=E5sdal=22?=

How about simply running it under a debugger and call your functions
from the debugger prompt ?
 
R

Ryan

Hi all,

Thanks for the quick feedback. You guys are the best.

Nils: Running the code under a debugger would essentially be a way around the
problem. However.. I was hoping to have the look-and-feel of a unix shell
environment simply be calling the executable (without the debugger). The
difference is that the "shell" would parse the solaris executable's symbol
table instead of directories in $PATH.

This is exactly what VxWorks provides when object files are loaded in.

Phlip: Using a test unit (such as CppUnit) is a good idea for regression
testing, but the project is unfortunately too complex to cover all paths with
scripts. Although my example used test.o, in reality there are hundreds of
files being parsed.

Ioannis: I will have a closer look at those links. Maybe they offer what I am
looking for.

Best regards,
Ryan
 
P

Phlip

Ryan said:
You guys are the best.

A minority opinion!
Phlip: Using a test unit (such as CppUnit) is a good idea for regression
testing, but the project is unfortunately too complex to cover all paths with
scripts. Although my example used test.o, in reality there are hundreds of
files being parsed.

There are those who claim that if you write tests before writing the tested
code, and if you only add code when you can force a test to fail and require
it, your tests will snuggle up against your code and cover all its paths
with a minimal set of tests.

There are also those who claim, given a project without the benefit of such
tests, you can rapidly rewrite it, test-first, and get all those benefits.

There are _also_ those who claim, given hundreds of tests cases, you should
put them all in a lite database (XML, Excel, etc.) and write a test fixture
to traverse all of them.
 
T

Thomas Maier-Komor

Ryan said:
Hi all,

Thanks for the quick feedback. You guys are the best.

Nils: Running the code under a debugger would essentially be a way
around the problem. However.. I was hoping to have the look-and-feel of
a unix shell environment simply be calling the executable (without the
debugger). The difference is that the "shell" would parse the solaris
executable's symbol table instead of directories in $PATH.

under solaris you could use sun's dbx (debugger of sun studio/compiler
collection), which actually has a ksh command line interface and tons
of other useful features...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top