From 305694ad2f2bd344bb9067162b78222d01923cc0 Mon Sep 17 00:00:00 2001 From: Martin Boonk Date: Tue, 7 May 2024 19:37:31 +0200 Subject: [PATCH] runapptests - Add verbose option --- bin/runapptests.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/bin/runapptests.js b/bin/runapptests.js index 1ead38d86..3ea2a9b55 100755 --- a/bin/runapptests.js +++ b/bin/runapptests.js @@ -35,6 +35,8 @@ if (!require("fs").existsSync(DIR_IDE)) { process.exit(1); } +const verbose = process.argv.includes("--verbose") || process.argv.includes("-v"); + var AppInfo = require(BASE_DIR+"/core/js/appinfo.js"); var apploader = require(BASE_DIR+"/core/lib/apploader.js"); apploader.init({ @@ -55,7 +57,7 @@ function ERROR(s) { } function getValue(js){ - if (verbose) + if(verbose) console.log(`> GETTING VALUE FOR \`${js}\``); emu.tx(`\x10print(JSON.stringify(${js}))\n`); var result = getSanitizedLastLine(); @@ -344,7 +346,15 @@ emu.init({ console.log("Loading tests"); let p = Promise.resolve(); let apps = apploader.apps; - if (process.argv.includes("--id")) apps = apps.filter(e=>e.id==process.argv[process.argv.indexOf("--id") + 1]); + if (process.argv.includes("--id")) { + let f = process.argv[process.argv.indexOf("--id") + 1]; + apps = apps.filter(e=>e.id==f); + if (apps.length == 0){ + console.log("No apps left after filtering for " + f); + process.exitCode(255); + } + } + apps.forEach(app => { var testFile = APP_DIR+"/"+app.id+"/test.json"; if (!require("fs").existsSync(testFile)) return;