comparison packages/kernel/current/tests/tm_basic.cxx @ 1001:b8e01d85e2d4

Add CDL to control number of times 'tests' run.
author gthomas
date Tue, 06 May 2003 16:10:02 +0000
parents 4bfb0d444b05
children 92cf4ff674de
comparison
equal deleted inserted replaced
1000:6204f4b6686d 1001:b8e01d85e2d4
7 //========================================================================== 7 //==========================================================================
8 //####ECOSGPLCOPYRIGHTBEGIN#### 8 //####ECOSGPLCOPYRIGHTBEGIN####
9 // ------------------------------------------- 9 // -------------------------------------------
10 // This file is part of eCos, the Embedded Configurable Operating System. 10 // This file is part of eCos, the Embedded Configurable Operating System.
11 // Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc. 11 // Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
12 // Copyright (C) 2002 Gary Thomas 12 // Copyright (C) 2002, 2003 Gary Thomas
13 // 13 //
14 // eCos is free software; you can redistribute it and/or modify it under 14 // eCos is free software; you can redistribute it and/or modify it under
15 // the terms of the GNU General Public License as published by the Free 15 // the terms of the GNU General Public License as published by the Free
16 // Software Foundation; either version 2 or (at your option) any later version. 16 // Software Foundation; either version 2 or (at your option) any later version.
17 // 17 //
1633 cyg_thread_delete(threads[i]); 1633 cyg_thread_delete(threads[i]);
1634 } 1634 }
1635 end_of_test_group(); 1635 end_of_test_group();
1636 } 1636 }
1637 1637
1638 void 1638 static void
1639 run_all_tests(CYG_ADDRESS id) 1639 _run_all_tests(CYG_ADDRESS id)
1640 { 1640 {
1641 int i, j; 1641 int i, j;
1642 cyg_uint32 tv[nsamples], tv0, tv1; 1642 cyg_uint32 tv[nsamples], tv0, tv1;
1643 cyg_uint32 min_stack, max_stack, total_stack, actual_stack; 1643 cyg_uint32 min_stack, max_stack, total_stack, actual_stack;
1644 cyg_tick_count_t ticks, tick0, tick1; 1644 cyg_tick_count_t ticks, tick0, tick1;
1778 1778
1779 enable_clock_latency_measurement(); 1779 enable_clock_latency_measurement();
1780 1780
1781 ticks = cyg_current_time(); 1781 ticks = cyg_current_time();
1782 diag_printf("\nTiming complete - %d ms total\n\n", (int)((ticks*ns_per_system_clock)/1000)); 1782 diag_printf("\nTiming complete - %d ms total\n\n", (int)((ticks*ns_per_system_clock)/1000));
1783 1783 }
1784
1785 void
1786 run_all_tests(CYG_ADDRESS id)
1787 {
1788 #if CYGNUM_TESTS_RUN_COUNT < 0
1789 while (1)
1790 #else
1791 int i;
1792 for (i = 0; i < CYGNUM_TESTS_RUN_COUNT; i++)
1793 #endif
1794 _run_all_tests(id);
1784 CYG_TEST_PASS_FINISH("Basic timing OK"); 1795 CYG_TEST_PASS_FINISH("Basic timing OK");
1785 } 1796 }
1786 1797
1787 void tm_basic_main( void ) 1798 void tm_basic_main( void )
1788 { 1799 {