nes-proj/tests/07-simulation-base/js/22-stack-check.js
2018-04-07 14:49:19 +01:00

26 lines
461 B
JavaScript

TIMEOUT(100000);
/* This script checks that the stack usage is dynamically changing */
var re = /stack usage: (\d+)/i;
var minusage = 10000;
var maxusage = 0;
while(true) {
log.log("> " + msg + "\n");
var found = msg.match(re);
if(found) {
var n = parseInt(found[1]);
minusage = minusage < n ? minusage : n;
maxusage = maxusage > n ? maxusage : n;
if(minusage < 800 && maxusage >= 1000) {
log.testOK();
}
}
YIELD();
}