nes-proj/tests/07-simulation-base/js/22-stack-check.js

26 lines
461 B
JavaScript
Raw Normal View History

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);
2018-04-07 13:19:58 +00:00
if(found) {
var n = parseInt(found[1]);
minusage = minusage < n ? minusage : n;
maxusage = maxusage > n ? maxusage : n;
2018-04-07 13:19:58 +00:00
if(minusage < 800 && maxusage >= 1000) {
log.testOK();
}
}
YIELD();
}