From 67b0bc4c70b978a634c017389a1736635852ef58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20K=C3=B6hlke?= Date: Tue, 30 Jul 2024 09:32:39 +0200 Subject: [PATCH 1/2] fix ceedling (>=1.0.0) version regex --- src/adapter.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/adapter.ts b/src/adapter.ts index c097634..e698ef7 100644 --- a/src/adapter.ts +++ b/src/adapter.ts @@ -388,7 +388,7 @@ export class CeedlingAdapter implements TestAdapter { private async getCeedlingVersion(): Promise { const result = await this.execCeedling(['version']); - const regex = new RegExp('^\\s*Ceedling::\\s*(.*)$', 'gm'); + const regex = new RegExp('Ceedling => (.*)$|Ceedling:: *(.*)$', 'gm'); const match = regex.exec(result.stdout); if (!match) { this.logger.error(`fail to get the ceedling version: ${util.format(result)}`); From c1c96c858d1d12101ecd7979f11b78fc53057b1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20K=C3=B6hlke?= Date: Tue, 30 Jul 2024 10:06:27 +0200 Subject: [PATCH 2/2] changed the regex version capture group from .* to [\d\.]* to only match numbers and points --- src/adapter.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/adapter.ts b/src/adapter.ts index e698ef7..0ed57a4 100644 --- a/src/adapter.ts +++ b/src/adapter.ts @@ -388,7 +388,7 @@ export class CeedlingAdapter implements TestAdapter { private async getCeedlingVersion(): Promise { const result = await this.execCeedling(['version']); - const regex = new RegExp('Ceedling => (.*)$|Ceedling:: *(.*)$', 'gm'); + const regex = new RegExp('Ceedling => *([\d\.]*)$|Ceedling:: *([\d\.]*)$', 'gm'); const match = regex.exec(result.stdout); if (!match) { this.logger.error(`fail to get the ceedling version: ${util.format(result)}`);