dejagnu
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Documenting how to do remote testing


From: Dan Kegel
Subject: Documenting how to do remote testing
Date: Mon, 09 Jun 2003 17:55:27 -0700
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.0) Gecko/20020615 Debian/1.0.0-3

The Dejagnu doc contains two different tries at documenting how
to do remote testing:
http://www.gnu.org/software/dejagnu/manual/x319.html
http://www.gnu.org/software/dejagnu/manual/releng.html

Neither of those really hits the mark for me.  The script MkTestDir
referred to by releng.html isn't online anywhere,
and x319.html seems to put board config info in a default file
in a way that probably only allows remote testing on one target.

I still have never managed to execute a gcc test remotely, so I'm
writing a simple, complete example as I figure things out myself.
I'm purposely not using autoconf, automake, or the standard 'testsuite/'
convention in this example to keep the example simple, and reduce the
number of files the user needs to confront during the example.

I've written a pair of files test2.{c,exp} (see below).
Assuming PATH includes the current directory, the command
   runtest test2.exp
will compile and run test2.c, and perform three simple execution tests on it.

Then, assuming the fluffy cloud of magic config files is set up properly, the 
command
   runtest --target=s390-ibm-linux-gnu test2.exp
should do the same thing but build the test with the appropriate cross-compiler,
and run the test on a remote s390 system whose access info is in one of the 
config files.

Can anyone review test2.{c,exp} for correctness, and
give me hints about the smallest possible set of config files
needed to run this test remotely on two different targets
using telnet/ftp?

Thanks!
- Dan


::::::::::::::
test2.c
::::::::::::::
#include <stdio.h>
int main(int argc, char **argv)
{
        printf("This is %s.  argc is %d\n", __FILE__, argc);
        printf("Exiting with status %d\n", atoi(argv[1]));
        return atoi(argv[1]);
}
::::::::::::::
test2.exp
::::::::::::::
# test2: compile and run a C program (possibly remotely) with various arguments

print "Compile test2.c"
target_compile test2.c test2 executable -O2

print "test2.1: Run test2, ask it to terminate with status 0, make sure it did"
set result [remote_load host test2 0]
if {[lindex $result 0] == "pass"} {
   pass "test2.1"
} else {
   fail "test2.1"
}

print "test2.2: Run test2, ask it to terminate with nonzero status, make sure 
it d
id"
set result [remote_load host test2 17]
if {[lindex $result 0] == "fail"} {
   pass "test2.2"
} else {
   fail "test2.2"
}

print "test2.3: Run test2, ask it to crash, make sure it did"
set result [remote_load host test2]
if {[lindex $result 0] == "fail"} {
   pass "test2.3"
} else {
   fail "test2.3"
}





reply via email to

[Prev in Thread] Current Thread [Next in Thread]