Changeset 7baf8c in git
- Timestamp:
- Sep 1, 1998, 2:03:13 PM (25 years ago)
- Branches:
- (u'spielwiese', '8d54773d6c9e2f1d2593a28bc68b7eeab54ed529')
- Children:
- 509f7da79288d60b228d336cdb74fb603908d0eb
- Parents:
- ebdd5691fee9e7877e3f88f06ad652986b39d74c
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/tst.lib
rebdd56 r7baf8c 1 // $Id: tst.lib,v 1.1 1 1998-07-14 06:50:11obachman Exp $1 // $Id: tst.lib,v 1.12 1998-09-01 12:03:13 obachman Exp $ 2 2 //(obachman, last modified 6/30/98) 3 3 ///////////////////////////////////////////////////////////////////////////// 4 4 5 version="$Id: tst.lib,v 1.1 1 1998-07-14 06:50:11obachman Exp $";5 version="$Id: tst.lib,v 1.12 1998-09-01 12:03:13 obachman Exp $"; 6 6 info=" 7 7 LIBRARY: tst.lib PROCEDURES FOR RUNNING AUTOMATIC TST TESTS … … 60 60 " 61 61 { 62 string s; 63 string keyword = ""; 64 link outlink = ""; 65 66 // Check # of args 67 if (size(#) < 1 || size(#) > 3) 68 { 69 "Error tst_ignore: Wrong number of arguments"; 70 "Usage: tst_ignore (any,[keyword], [link]);"; 71 return(); 72 } 73 74 // Get Args 75 s = string(#[1]); 76 if (size(#) == 3) 77 { 78 keyword = #[2]; 79 outlink = #[3]; 80 } 81 if (size(#) == 2) 82 { 83 if (typeof(#[2]) == "string") 62 if (! defined(tst_no_status)) 63 { 64 string s; 65 string keyword = ""; 66 link outlink = ""; 67 68 // Check # of args 69 if (size(#) < 1 || size(#) > 3) 70 { 71 "Error tst_ignore: Wrong number of arguments"; 72 "Usage: tst_ignore (any,[keyword], [link]);"; 73 return(); 74 } 75 76 // Get Args 77 s = string(#[1]); 78 if (size(#) == 3) 84 79 { 85 80 keyword = #[2]; 81 outlink = #[3]; 82 } 83 if (size(#) == 2) 84 { 85 if (typeof(#[2]) == "string") 86 { 87 keyword = #[2]; 88 } 89 else 90 { 91 outlink = #[2]; 92 } 93 } 94 95 // check args 96 if (typeof(keyword) != "string") 97 { 98 "Error tst_ignore: Keyword must be a string"; 99 "Usage: tst_ignore (any,[keyword], [link]);"; 100 return(); 101 } 102 103 if (status(outlink, "open", "no")) 104 { 105 open(outlink); 106 } 107 108 if (status(outlink, "write", "not ready")) 109 { 110 "Error tst_ignore: Can not write to link"; 111 outlink; 112 "Usage: tst_ignore (any,[keyword], [link]);"; 113 return(); 114 } 115 116 // ready -- do the actual work 117 if (keyword != "") 118 { 119 write(outlink,"// tst_ignore:" + keyword + " :: " + tst_system("hostname", 1) + ":" + s); 86 120 } 87 121 else 88 122 { 89 outlink = #[2]; 90 } 91 } 92 93 // check args 94 if (typeof(keyword) != "string") 95 { 96 "Error tst_ignore: Keyword must be a string"; 97 "Usage: tst_ignore (any,[keyword], [link]);"; 98 return(); 99 } 100 101 if (status(outlink, "open", "no")) 102 { 103 open(outlink); 104 } 105 106 if (status(outlink, "write", "not ready")) 107 { 108 "Error tst_ignore: Can not write to link"; 109 outlink; 110 "Usage: tst_ignore (any,[keyword], [link]);"; 111 return(); 112 } 113 114 // ready -- do the actual work 115 if (keyword != "") 116 { 117 write(outlink,"// tst_ignore:" + keyword + " :: " + tst_system("hostname", 1) + ":" + s); 118 } 119 else 120 { 121 write(outlink, "// tst_ignore: " + s); 123 write(outlink, "// tst_ignore: " + s); 124 } 122 125 } 123 126 } … … 190 193 " 191 194 { 192 if (! defined(tst_status_counter)) 193 { 194 int tst_status_counter = 1; 195 export tst_status_counter; 196 } 197 else 198 { 199 tst_status_counter++; 200 } 201 202 tst_status_out(tst_status_counter, "tst_memory_0", memory(0)); 203 tst_status_out(tst_status_counter, "tst_memory_1", memory(1)); 204 tst_status_out(tst_status_counter, "tst_memory_2", memory(2)); 205 if (size(#) > 0) 206 { 207 tst_status_out(tst_status_counter, "tst_timer_1", timer); 208 } 209 else 210 { 211 tst_status_out(tst_status_counter, "tst_timer", timer - Get_tst_timer()); 212 Set_tst_timer(timer); 213 } 214 string(tst_status_counter) + " >> " + GetTstStatusFile(); 195 if (! defined(tst_no_status)) 196 { 197 if (! defined(tst_status_counter)) 198 { 199 int tst_status_counter = 1; 200 export tst_status_counter; 201 } 202 else 203 { 204 tst_status_counter++; 205 } 206 207 tst_status_out(tst_status_counter, "tst_memory_0", memory(0)); 208 tst_status_out(tst_status_counter, "tst_memory_1", memory(1)); 209 tst_status_out(tst_status_counter, "tst_memory_2", memory(2)); 210 if (size(#) > 0) 211 { 212 tst_status_out(tst_status_counter, "tst_timer_1", timer); 213 } 214 else 215 { 216 tst_status_out(tst_status_counter, "tst_timer", timer - Get_tst_timer()); 217 Set_tst_timer(timer); 218 } 219 string(tst_status_counter) + " >> " + GetTstStatusFile(); 220 } 215 221 } 216 222 example … … 232 238 " 233 239 { 234 write(":w " + GetTstStatusFile(), "Status Output of " + GetTstStatusFile()); 235 tst_status_out("init", "USER :" + system("getenv", "USER")); 236 tst_status_out("init", "HOSTNAME:" + tst_system("hostname", 1)); 237 tst_status_out("init", "uname -a:" + tst_system("uname -a", 1)); 238 tst_status_out("init", "date :" + tst_system("date", 1)); 239 tst_status_out("init", "version :" + string(system("version"))); 240 tst_status_out("init", "ticks :" + system("--ticks-per-sec")); 241 "init >> " + GetTstStatusFile(); 240 if (! defined(tst_no_status)) 241 { 242 write(":w " + GetTstStatusFile(), "Status Output of " + GetTstStatusFile()); 243 tst_status_out("init", "USER :" + system("getenv", "USER")); 244 tst_status_out("init", "HOSTNAME:" + tst_system("hostname", 1)); 245 tst_status_out("init", "uname -a:" + tst_system("uname -a", 1)); 246 tst_status_out("init", "date :" + tst_system("date", 1)); 247 tst_status_out("init", "version :" + string(system("version"))); 248 tst_status_out("init", "ticks :" + system("--ticks-per-sec")); 249 "init >> " + GetTstStatusFile(); 250 } 242 251 } 243 252 example
Note: See TracChangeset
for help on using the changeset viewer.