Changeset cb13f0 in git
- Timestamp:
- Jun 30, 1998, 4:48:21 PM (26 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- b240fff7d1e54539abddf713f54ac34ffa1ec1fa
- Parents:
- e960fdfc67b70f59abfe61acd935550f509a386c
- Location:
- Singular
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/tst.lib
re960fdf rcb13f0 1 // $Id: tst.lib,v 1. 8 1998-06-12 17:41:42obachman Exp $2 //(obachman, last modified 2/13/98)1 // $Id: tst.lib,v 1.9 1998-06-30 14:48:21 obachman Exp $ 2 //(obachman, last modified 6/30/98) 3 3 ///////////////////////////////////////////////////////////////////////////// 4 4 5 version="$Id: tst.lib,v 1. 8 1998-06-12 17:41:42obachman Exp $";5 version="$Id: tst.lib,v 1.9 1998-06-30 14:48:21 obachman Exp $"; 6 6 info=" 7 7 LIBRARY: tst.lib PROCEDURES FOR RUNNING AUTOMATIC TST TESTS … … 13 13 tst_init() writes some identification data to stdout 14 14 with tst_ignore 15 tst_status([any]) writes status info to stdout with tst_ignore() 15 16 tst_groebnerTest(ideal i) 16 17 tests groebner command … … 32 33 errno = system("sh", s); 33 34 s = read(tmpfile); 34 errno = system("sh", "rm " + tmpfile);35 errno = system("sh", "rm -f " + tmpfile); 35 36 return (s); 36 37 } … … 46 47 "USAGE: tst_ignore(any,[keyword], [link]) 47 48 any -- valid argument to string() 48 keyword -- one of \"time\" or \"memory\"49 keyword -- an arbitrary string 49 50 link -- a link which can be written to 50 51 RETURN: none; writes string(any) to link (or stdout, if no link given), 51 prepending prefix \"// ignore:\", or \"// ignore: time:\",52 \"//ignore: memory:\" if called with the respective keywords;53 should be used in tst files to output system dependent data54 (like date, pathnames) { and timings With the keyword \"time\",55 resp. memory usage with the keyword \"memory\"52 prepending prefix \"// ignore:\", or 53 \"// ignore:keyword hostname:\", 54 if keyword was given. 55 Should be used in tst files to output system dependent data 56 (like date, pathnames). 56 57 EXAMPLE: example tst_ignore; shows examples 57 58 " … … 95 96 return(); 96 97 } 97 if (keyword == "time" || keyword == "memory")98 {99 keyword = keyword + ": ";100 }101 else102 {103 if (keyword != "")104 {105 "Warning tst_ignore: keyword should be \"time\" or \"memory\"";106 }107 }108 98 109 99 if (status(outlink, "open", "no")) … … 111 101 open(outlink); 112 102 } 103 113 104 if (status(outlink, "write", "not ready")) 114 105 { … … 120 111 121 112 // ready -- do the actual work 122 write(outlink, "// ignore: " + keyword + s); 113 if (keyword != "") 114 { 115 if (! defined(tst_hostname)) 116 { 117 string tst_hostname = tst_system("hostname"); 118 tst_hostname = tst_hostname[1..size(tst_hostname)-1]; 119 export tst_hostname; 120 } 121 122 write(outlink, "// ignore:" + keyword + " " + tst_hostname + ":" + s); 123 } 124 else 125 { 126 write(outlink, "// ignore: " + s); 127 } 123 128 } 124 129 example … … 135 140 } 136 141 142 proc tst_status (list #) 143 "USAGE: tst_status([any]) 144 RETURN: none; writes to stdout the current memory usage and used time 145 since last call to tst_status(), if no argument is given, or, 146 since start-up of Singular, if an argument is given. 147 NOTE: Should be used regularly within tst files to enable automatic 148 tracking of memory and time performance. 149 EXAMPLE: example tst_status; shows example 150 " 151 { 152 tst_ignore(memory(0), "tst_memory_0"); 153 tst_ignore(memory(1), "tst_memory_1"); 154 tst_ignore(memory(2), "tst_memory_2"); 155 if (size(#) > 0) 156 { 157 tst_ignore(timer, "tst_timer_1"); 158 } 159 else 160 { 161 if (! defined(tst_timer)) 162 { 163 int tst_timer = 0; 164 export tst_timer; 165 } 166 tst_ignore(timer - tst_timer, "tst_timer"); 167 tst_timer = timer; 168 } 169 } 170 example 171 { 172 "EXAMPLE"; echo = 2; 173 tst_status(); 174 ring r; 175 poly p = (x+y+z)^40; 176 tst_status(); 177 tst_status(1); 178 } 179 180 137 181 proc tst_init 138 182 "USAGE: tst_init() … … 142 186 " 143 187 { 188 if (! defined(tst_hostname)) 189 { 190 string tst_hostname = tst_system("hostname"); 191 tst_hostname = tst_hostname[1..size(tst_hostname)-1]; 192 export tst_hostname; 193 } 144 194 tst_ignore("USER : " + system("getenv", "USER")); 145 tst_ignore("HOSTNAME: " + system("getenv", "HOST"));195 tst_ignore("HOSTNAME: " + tst_hostname); 146 196 tst_ignore("uname -a: " + tst_system("uname -a")); 147 197 tst_ignore("date : " + tst_system("date")); 148 198 tst_ignore("version : " + string(system("version"))); 199 tst_ignore("ticks : " + system("--ticks-per-sec")); 200 if (! defined(tst_timer)) 201 { 202 int tst_timer; 203 export tst_timer; 204 } 205 206 tst_status(); 149 207 } 150 208 example -
Singular/syz1.cc
re960fdf rcb13f0 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: syz1.cc,v 1. 29 1998-06-29 13:16:37 pohlExp $ */4 /* $Id: syz1.cc,v 1.30 1998-06-30 14:48:20 obachman Exp $ */ 5 5 /* 6 6 * ABSTRACT: resolutions … … 504 504 else 505 505 { 506 poly p,result=p=p New();506 poly p,result=p=pInit(); 507 507 number n; 508 508 loop
Note: See TracChangeset
for help on using the changeset viewer.