|
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 |
|
|
25 // by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. |
|
|
26 // ------------------------------------------- |
|
|
27 // |
|
|
28 //####COPYRIGHTEND#### |
|
|
29 //========================================================================== |
|
|
30 //#####DESCRIPTIONBEGIN#### |
|
|
31 // |
|
|
32 // Author(s): dsm |
|
|
33 // Contributors: dsm |
|
|
34 // Date: 1998-03-17 |
|
|
35 // Description: Test harness implementation that uses the infrastructure |
|
|
36 // diag channel. This is intended for manual testing. |
|
|
37 // |
|
|
38 //####DESCRIPTIONEND#### |
|
|
39 |
|
|
40 #include <pkgconf/system.h> |
|
|
41 #include <pkgconf/infra.h> |
|
|
42 |
|
|
43 #include <cyg/infra/cyg_type.h> // base types |
|
|
44 #include <cyg/infra/diag.h> // HAL polled output |
|
|
45 #include <cyg/infra/testcase.h> // what we implement |
|
|
46 |
|
|
47 void cyg_test_init() |
|
|
48 { |
|
|
49 diag_init(); |
|
|
50 } |
|
|
51 |
|
|
52 void cyg_test_output(int status, char *msg, int line, char *file) |
|
|
53 { |
|
|
54 char *st = "UNKNOWN STATUS:"; |
|
|
55 |
|
|
56 switch (status) { |
|
|
57 case 0: |
|
|
58 st = "FAIL:"; |
|
|
59 break; |
|
|
60 case 1: |
|
|
61 st = "PASS:"; |
|
|
62 break; |
|
|
63 case 2: |
|
|
64 st = "EXIT:"; |
|
|
65 break; |
|
|
66 case 3: |
|
|
67 st = "INFO:"; |
|
|
68 break; |
|
|
69 } |
|
|
70 |
|
|
71 diag_write_string(st); |
|
|
72 diag_write_char('<'); |
|
|
73 diag_write_string(msg); |
|
|
74 diag_write_char('>'); |
|
|
75 if( 0 == status ) { |
|
|
76 diag_write_string(" Line: "); |
|
|
77 diag_write_dec(line); |
|
|
78 diag_write_string(", File: "); |
|
|
79 diag_write_string(file); |
|
|
80 } |
|
|
81 diag_write_char('\n'); |
|
|
82 } |
|
|
83 |
|
|
84 // This is an appropriate function to set a breakpoint on |
|
|
85 void cyg_test_exit() |
|
|
86 { |
|
|
87 for(;;) |
|
|
88 ; |
|
|
89 } |
|
|
90 // EOF tcdiag.cxx |