This is the mail archive of the ecos-patches@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

INFRA - CDL controlling tests


I found it useful to run some tests over and over.  This CDL 
can make that configurable - as we move the support into the 
various tests.  For now, I've only done 'tm_basic' (watch this 
space for more).

Of course, the default will remain "once through"

-- 
Gary Thomas <gary@mlbassoc.com>
MLB Associates
Index: infra/current/ChangeLog
===================================================================
RCS file: /misc/cvsfiles/ecos/packages/infra/current/ChangeLog,v
retrieving revision 1.36
diff -u -5 -p -r1.36 ChangeLog
--- infra/current/ChangeLog	25 Apr 2003 19:56:34 -0000	1.36
+++ infra/current/ChangeLog	5 May 2003 14:28:09 -0000
@@ -1,5 +1,9 @@
+2003-05-05  Gary Thomas  <gary@mlbassoc.com>
+
+	* cdl/infra.cdl: Add option to control number of times tests run.
+
 2003-04-25  Jonathan Larmour  <jifl@eCosCentric.com>
 
 	* tests/cxxsupp.cxx: don't include <pkgconf/kernel.h> as it's not
 	needed.
 	(cyg_start): CYGINT_ISO_MALLOC needs a #if test.
Index: infra/current/cdl/infra.cdl
===================================================================
RCS file: /misc/cvsfiles/ecos/packages/infra/current/cdl/infra.cdl,v
retrieving revision 1.9
diff -u -5 -p -r1.9 infra.cdl
--- infra/current/cdl/infra.cdl	10 Apr 2003 18:08:36 -0000	1.9
+++ infra/current/cdl/infra.cdl	6 May 2003 14:43:25 -0000
@@ -299,14 +299,25 @@ cdl_package CYGPKG_INFRA {
                 This option modifies the set of linker flags for
                 building the eCos infra package tests. These flags are added to
                 the set of global flags if present."
         }
 
-        cdl_option CYGPKG_INFRA_TESTS {
+        cdl_component CYGPKG_INFRA_TESTS {
             display "Infra package tests"
             flavor  data
             no_define
             calculated { "tests/cxxsupp" }
+
+            cdl_option CYGNUM_TESTS_RUN_COUNT {
+                display "Number of times a test runs"
+                flavor  data
+                default_value 1	
+                description "
+                    This option controls the number of times tests will execute their
+                    basic function.  Not all tests will honor this setting, but those
+                    that do will execute the test N times before terminating.  A value
+                    less than 0 indicates to run forever."
+            }
         }
 
     }
 }
Index: kernel/current/ChangeLog
===================================================================
RCS file: /misc/cvsfiles/ecos/packages/kernel/current/ChangeLog,v
retrieving revision 1.100
diff -u -5 -p -r1.100 ChangeLog
--- kernel/current/ChangeLog	3 May 2003 14:22:13 -0000	1.100
+++ kernel/current/ChangeLog	5 May 2003 14:28:57 -0000
@@ -1,5 +1,11 @@
+2003-05-05  Gary Thomas  <gary@mlbassoc.com>
+
+	* tests/tm_basic.cxx: Support new option controlling number of times
+	this test runs.  This is useful for long-term stress and performance
+	analysis.
+
 2003-05-03  Jonathan Larmour  <jifl@eCosCentric.com>
 
 	* include/mqueue.inl (Cyg_Mqueue::get): Fix invalid loop termination
 	cheque for whether busy or not.
 	(Cyg_Mqueue::put): Ditto.
Index: kernel/current/tests/tm_basic.cxx
===================================================================
RCS file: /misc/cvsfiles/ecos/packages/kernel/current/tests/tm_basic.cxx,v
retrieving revision 1.19
diff -u -5 -p -r1.19 tm_basic.cxx
--- kernel/current/tests/tm_basic.cxx	3 Dec 2002 14:25:23 -0000	1.19
+++ kernel/current/tests/tm_basic.cxx	6 May 2003 14:43:55 -0000
@@ -7,11 +7,11 @@
 //==========================================================================
 //####ECOSGPLCOPYRIGHTBEGIN####
 // -------------------------------------------
 // This file is part of eCos, the Embedded Configurable Operating System.
 // Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
-// Copyright (C) 2002 Gary Thomas
+// Copyright (C) 2002, 2003 Gary Thomas
 //
 // eCos is free software; you can redistribute it and/or modify it under
 // the terms of the GNU General Public License as published by the Free
 // Software Foundation; either version 2 or (at your option) any later version.
 //
@@ -1633,12 +1633,12 @@ run_sched_tests(void)
         cyg_thread_delete(threads[i]);
     }
     end_of_test_group();
 }
 
-void 
-run_all_tests(CYG_ADDRESS id)
+static void 
+_run_all_tests(CYG_ADDRESS id)
 {
     int i, j;
     cyg_uint32 tv[nsamples], tv0, tv1;
     cyg_uint32 min_stack, max_stack, total_stack, actual_stack;
     cyg_tick_count_t ticks, tick0, tick1;
@@ -1778,11 +1778,22 @@ run_all_tests(CYG_ADDRESS id)
     
     enable_clock_latency_measurement();
 
     ticks = cyg_current_time();
     diag_printf("\nTiming complete - %d ms total\n\n", (int)((ticks*ns_per_system_clock)/1000));
+}
 
+void 
+run_all_tests(CYG_ADDRESS id)
+{
+#if CYGNUM_TESTS_RUN_COUNT < 0
+    while (1)
+#else       
+    int i;
+    for (i = 0;  i < CYGNUM_TESTS_RUN_COUNT;  i++)
+#endif
+        _run_all_tests(id);
     CYG_TEST_PASS_FINISH("Basic timing OK");
 }
 
 void tm_basic_main( void )
 {

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]