diff options
author | mjb2 <mjb2@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-09-25 20:34:56 +0000 |
---|---|---|
committer | mjb2 <mjb2@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-09-25 20:34:56 +0000 |
commit | cb65fcb34415b24bf9a05b31b1158bcd367c786b (patch) | |
tree | 4f2c6937e3f531787906a7ab3225d5f6688e3704 /TAO/tests/CDR | |
parent | 4e50919c80edb75fb4f457a81a02648142a6ef98 (diff) | |
download | ATCD-cb65fcb34415b24bf9a05b31b1158bcd367c786b.tar.gz |
See Fri Sep 25 15:31:17 1998 Matthew J Braun <mjb2@cec.wustl.edu>
Diffstat (limited to 'TAO/tests/CDR')
-rw-r--r-- | TAO/tests/CDR/basic_types.cpp | 45 | ||||
-rw-r--r-- | TAO/tests/CDR/growth.cpp | 8 | ||||
-rwxr-xr-x | TAO/tests/CDR/run_test.pl | 41 |
3 files changed, 86 insertions, 8 deletions
diff --git a/TAO/tests/CDR/basic_types.cpp b/TAO/tests/CDR/basic_types.cpp index 2a6ede7c64a..0d8714ac616 100644 --- a/TAO/tests/CDR/basic_types.cpp +++ b/TAO/tests/CDR/basic_types.cpp @@ -22,7 +22,7 @@ ACE_RCSID(CDR, basic_types, "$Id$") -static const int n = 4096; +static int n = 4096; static int nloops = 100; struct CDR_Test_Types @@ -220,6 +220,35 @@ main (int argc, char *argv[]) TAO_TRY_ENV); TAO_CHECK_ENV; + ACE_Get_Opt get_opt (argc, argv, "dn:l:"); + int opt; + + while ((opt = get_opt ()) != EOF) + { + switch (opt) + { + case 'd': + TAO_debug_level++; + break; + case 'n': + n = ACE_OS::atoi (get_opt.optarg); + break; + case 'l': + nloops = ACE_OS::atoi (get_opt.optarg); + break; + case '?': + default: + ACE_DEBUG ((LM_DEBUG, + "Usage: %s " + "-d debug" + "-n <num> " + "-l <loops> " + "\n", + argv[0])); + return -1; + } + } + for (int i = 0; i < nloops; ++i) { TAO_OutputCDR output; @@ -230,12 +259,14 @@ main (int argc, char *argv[]) return 1; } TAO_InputCDR input (output); -#if 0 - ACE_DEBUG ((LM_DEBUG, "Output CDR: \n")); - ACE_HEX_DUMP ((LM_DEBUG, input.rd_ptr(), 64)); - ACE_DEBUG ((LM_DEBUG, "Input CDR: \n")); - ACE_HEX_DUMP ((LM_DEBUG, input.rd_ptr(), 64)); -#endif + if (TAO_debug_level > 0) + { + ACE_DEBUG ((LM_DEBUG, "Output CDR: \n")); + ACE_HEX_DUMP ((LM_DEBUG, input.rd_ptr(), 64)); + ACE_DEBUG ((LM_DEBUG, "Input CDR: \n")); + ACE_HEX_DUMP ((LM_DEBUG, input.rd_ptr(), 64)); + } + if (test_get (input, test_types) != 0) { return 1; diff --git a/TAO/tests/CDR/growth.cpp b/TAO/tests/CDR/growth.cpp index 0f1ee6c085f..80dd5518eef 100644 --- a/TAO/tests/CDR/growth.cpp +++ b/TAO/tests/CDR/growth.cpp @@ -67,13 +67,16 @@ main (int argc, char *argv[]) int hi = 4096; int s = 4; - ACE_Get_Opt get_opt (argc, argv, "n:l:h:s:"); + ACE_Get_Opt get_opt (argc, argv, "dn:l:h:s:"); int opt; while ((opt = get_opt ()) != EOF) { switch (opt) { + case 'd': + TAO_debug_level++; + break; case 'n': n = ACE_OS::atoi (get_opt.optarg); break; @@ -90,6 +93,7 @@ main (int argc, char *argv[]) default: ACE_DEBUG ((LM_DEBUG, "Usage: %s " + "-d debug" "-l low " "-h high " "-s step " @@ -109,6 +113,8 @@ main (int argc, char *argv[]) { ACE_High_Res_Timer writing; ACE_High_Res_Timer reading; + if (TAO_debug_level > 0) + ACE_DEBUG ((LM_DEBUG, "\nx= %d\n", x)); for (int i = 0; i < n; ++i) { diff --git a/TAO/tests/CDR/run_test.pl b/TAO/tests/CDR/run_test.pl new file mode 100755 index 00000000000..8bb6c3687bb --- /dev/null +++ b/TAO/tests/CDR/run_test.pl @@ -0,0 +1,41 @@ +# $Id$ +# -*- perl -*- +eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' + & eval 'exec perl -S $0 $argv:q' + if 0; + +use lib "../../../bin"; +require ACEutils; + +$brace="\#\#\#\#\#"; +$cdr_iter = 100; +@tests = ("basic_types", "tc", "growth"); +@argslist = ("-n 256 -l 10", "", "-l 64 -h 256 -s 4 -n 100"); +$test = ""; +$args = ""; +$| = 1; +print STDERR "\n"; + +sub run_test +{ + #my $test = shift (@tests); + my $args = shift (@argslist); + + print STDERR "\n$brace $test $args test BEGUN\n"; + $TST = Process::Create (".".$DIR_SEPARATOR."$test".$Process::EXE_EXT, + "$args"); + print STDERR "\t$test RUNNING\n"; + $retval = ($TST->Wait ()) / 256; + if (retval != 0) + { + print STDERR "$brace $test $args FAILED; exited with value $retval\n"; + } + print STDERR "$brace $test ENDED successfully\n"; +} + +foreach $test (@tests) +{ + run_test ($test, $args); +} + + |