|
0
|
1 //========================================================================== |
|
|
2 // |
|
|
3 // tcdiag.cxx |
|
|
4 // |
|
|
5 // Infrastructure diag test harness. |
|
|
6 // |
|
|
7 //========================================================================== |
|
|
8 //####COPYRIGHTBEGIN#### |
|
|
9 // |
|
|
10 // ------------------------------------------- |
|
|
11 // The contents of this file are subject to the Cygnus eCos Public License |
|
|
12 // Version 1.0 (the "License"); you may not use this file except in |
|
|
13 // compliance with the License. You may obtain a copy of the License at |
|
|
14 // http://sourceware.cygnus.com/ecos |
|
|
15 // |
|
|
16 // Software distributed under the License is distributed on an "AS IS" |
|
|
17 // basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the |
|
|
18 // License for the specific language governing rights and limitations under |
|
|
19 // the License. |
|
|
20 // |
|
|
21 // The Original Code is eCos - Embedded Cygnus Operating System, released |
|
|
22 // September 30, 1998. |
|
|
23 // |
|
|
24 // The Initial Developer of the Original Code is Cygnus. Portions created |
|
2
|
25 // by Cygnus are Copyright (C) 1998,1999 Cygnus Solutions. All Rights Reserved. |
|
0
|
26 // ------------------------------------------- |
|
|
27 // |
|
|
28 //####COPYRIGHTEND#### |
|
|
29 //========================================================================== |
|
|
30 //#####DESCRIPTIONBEGIN#### |
|
|
31 // |
|
|
32 // Author(s): dsm |
|
2
|
33 // Contributors: dsm, jlarmour |
|
|
34 // Date: 1999-02-16 |
|
0
|
35 // Description: Test harness implementation that uses the infrastructure |
|
|
36 // diag channel. This is intended for manual testing. |
|
|
37 // |
|
|
38 //####DESCRIPTIONEND#### |
|
|
39 |
|
2
|
40 #include <cyg/infra/cyg_type.h> // base types |
|
|
41 #include <cyg/infra/diag.h> // HAL polled output |
|
|
42 #include <cyg/infra/testcase.h> // what we implement |
|
0
|
43 |
|
2
|
44 int cyg_test_is_simulator = 0; // infrastructure changes as necessary |
|
0
|
45 |
|
2
|
46 externC void |
|
|
47 cyg_test_init(void) |
|
0
|
48 { |
|
2
|
49 // currently nothing |
|
0
|
50 } |
|
|
51 |
|
2
|
52 externC void |
|
|
53 cyg_test_output(Cyg_test_code status, const char *msg, int line, |
|
|
54 const char *file) |
|
0
|
55 { |
|
2
|
56 char *st; |
|
0
|
57 |
|
|
58 switch (status) { |
|
2
|
59 case CYGNUM_TEST_FAIL: |
|
0
|
60 st = "FAIL:"; |
|
|
61 break; |
|
2
|
62 case CYGNUM_TEST_PASS: |
|
0
|
63 st = "PASS:"; |
|
|
64 break; |
|
2
|
65 case CYGNUM_TEST_EXIT: |
|
0
|
66 st = "EXIT:"; |
|
|
67 break; |
|
2
|
68 case CYGNUM_TEST_INFO: |
|
0
|
69 st = "INFO:"; |
|
|
70 break; |
|
2
|
71 case CYGNUM_TEST_GDBCMD: |
|
|
72 st = "GDB:"; |
|
|
73 break; |
|
|
74 case CYGNUM_TEST_NA: |
|
|
75 st = "NOTAPPLICABLE:"; |
|
|
76 break; |
|
|
77 default: |
|
|
78 st = "UNKNOWN STATUS:"; |
|
|
79 break; |
|
0
|
80 } |
|
|
81 |
|
|
82 diag_write_string(st); |
|
|
83 diag_write_char('<'); |
|
|
84 diag_write_string(msg); |
|
|
85 diag_write_char('>'); |
|
2
|
86 if( CYGNUM_TEST_FAIL == status ) { |
|
|
87 diag_write_string(" Line: "); |
|
|
88 diag_write_dec(line); |
|
|
89 diag_write_string(", File: "); |
|
|
90 diag_write_string(file); |
|
0
|
91 } |
|
|
92 diag_write_char('\n'); |
|
|
93 } |
|
|
94 |
|
|
95 // This is an appropriate function to set a breakpoint on |
|
2
|
96 externC void |
|
|
97 cyg_test_exit(void) |
|
0
|
98 { |
|
|
99 for(;;) |
|
|
100 ; |
|
|
101 } |
|
|
102 // EOF tcdiag.cxx |