Add -e flag to runtests.sh to stop tests after a given file

This is useful when trying to debug an error that only happens after a
number of other tests have run -- specify -e and run tests from either
an earlier file with -s or from the beginning.
This commit is contained in:
Dan Stillman 2017-06-20 00:47:13 -04:00
parent dcfddac519
commit c11f1069d7
3 changed files with 13 additions and 1 deletions

View file

@ -240,6 +240,7 @@ if(run && ZoteroUnit.tests) {
var enumerator = testDirectory.directoryEntries;
let startFile = ZoteroUnit.startAt ? getTestFilename(ZoteroUnit.startAt) : false;
let started = !startFile;
let stopFile = ZoteroUnit.stopAt ? getTestFilename(ZoteroUnit.stopAt) : false;
while(enumerator.hasMoreElements()) {
var file = enumerator.getNext().QueryInterface(Components.interfaces.nsIFile);
if(file.leafName.endsWith(".js")) {
@ -247,6 +248,9 @@ if(run && ZoteroUnit.tests) {
testFiles.push(file.leafName);
started = true;
}
if (file.leafName == stopFile) {
break;
}
}
}
if (!started) {