From 412a14c2adc0f0892cbcb802bfb881af62c55fe0 Mon Sep 17 00:00:00 2001 From: Martin Boonk Date: Sat, 4 May 2024 10:45:54 +0200 Subject: [PATCH] runapptests - Allow uploading files --- bin/runapptests.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/bin/runapptests.js b/bin/runapptests.js index 892cf66fa..195040826 100755 --- a/bin/runapptests.js +++ b/bin/runapptests.js @@ -35,6 +35,7 @@ if (!require("fs").existsSync(DIR_IDE)) { process.exit(1); } +var AppInfo = require(BASE_DIR+"/core/js/appinfo.js"); var apploader = require(BASE_DIR+"/core/lib/apploader.js"); apploader.init({ DEVICEID : DEVICEID @@ -235,7 +236,13 @@ function runStep(step, subtest, test, state){ case "sleep" : p = p.then(new Promise(resolve => { console.log("Start waiting for", step.ms); - setTimeout(resolve, step.ms) + setTimeout(resolve, step.ms); + })); + break; + case "upload" : + p = p.then(new Promise(() => { + console.log("Uploading", step.file); + emu.tx(AppInfo.getFileUploadCommands(step.as, require("fs").readFileSync(BASE_DIR + "/" + step.file).toString())); })); break; default: ERROR("Unknown step type "+step.t);