pike.git/
bin/
test_pike.pike
Branch:
Tag:
Non-build tags
All tags
No tags
1998-04-16
1998-04-16 01:10:40 by Fredrik Hübinette (Hubbe) <hubbe@hubbe.net>
dddccc9bdead29800b8856537448cb28a395ba0b (
16
lines) (+
14
/-
2
)
[
Show
|
Annotate
]
Branch:
7.9
condition cache implemented, should speed up testing a few percent
Rev: bin/test_pike.pike:1.12
1:
#!/usr/local/bin/pike
-
/* $Id: test_pike.pike,v 1.
11
1998/04/
11
11
:
53
:
35
grubba
Exp $ */
+
/* $Id: test_pike.pike,v 1.
12
1998/04/
16
01
:
10
:
40
hubbe
Exp $ */
#include <simulate.h>
13:
if(opt=="" || !opt) return 1; return (int)opt; }
+
+
mapping(string:int) cond_cache=([]);
+
int main(int argc, string *argv) { int e, verbose, successes, errors, t, check;
96:
test=tests[e]; if(sscanf(test,"COND %s\n%s",condition,test)==2) {
-
if(!clone(compile_string("mixed
c()
{
return
"+condition+";
}","Cond
"+
(
e+1)))->c
())
+
int
tmp;
+
if
(
!
(
tmp=cond_cache[condition]
))
{
-
+
tmp=!!(clone(compile_string("mixed c() { return "+condition+"; }","Cond "+(e+1)))->c());
+
if(!tmp) tmp=-1;
+
cond_cache[condition]=tmp;
+
}
+
+
if(tmp==-1)
+
{
if(verbose) werror("Not doing test "+(e+1)+"\n"); successes++;