From 9257a15a687b7c340e28ea187f2bf7e3848b9b0f Mon Sep 17 00:00:00 2001 From: Rainer Keller Date: Wed, 19 Oct 2022 13:30:29 +0200 Subject: [PATCH] McuSupport: The armgcc version string does not contain 'v' MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ic259bed17a97bccb64f427ce2054efc9d05b55f2 Reviewed-by: Dawid Śliwa Reviewed-by: Christian Stenger --- src/plugins/mcusupport/test/armgcc_ek_ra6m3g_baremetal_json.h | 2 +- src/plugins/mcusupport/test/armgcc_ek_ra6m3g_freertos_json.h | 2 +- src/plugins/mcusupport/test/armgcc_example_baremetal_json.h | 2 +- .../mcusupport/test/armgcc_mimxrt1050_evk_baremetal_json.h | 2 +- .../mcusupport/test/armgcc_mimxrt1050_evk_freertos_json.h | 2 +- .../mcusupport/test/armgcc_mimxrt1060_evk_baremetal_json.h | 2 +- .../mcusupport/test/armgcc_mimxrt1064_evk_baremetal_json.h | 2 +- .../mcusupport/test/armgcc_mimxrt1064_evk_freertos_json.h | 2 +- .../mcusupport/test/armgcc_mimxrt1170_evk_freertos_json.h | 2 +- .../test/armgcc_stm32f469i_discovery_baremetal_json.h | 2 +- .../test/armgcc_stm32f769i_discovery_baremetal_json.h | 2 +- .../test/armgcc_stm32f769i_discovery_freertos_json.h | 2 +- .../test/armgcc_stm32h750b_discovery_baremetal_json.h | 2 +- src/plugins/mcusupport/test/unittest.cpp | 4 ++-- 14 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/plugins/mcusupport/test/armgcc_ek_ra6m3g_baremetal_json.h b/src/plugins/mcusupport/test/armgcc_ek_ra6m3g_baremetal_json.h index 84e29625de0..3cc40f01d39 100644 --- a/src/plugins/mcusupport/test/armgcc_ek_ra6m3g_baremetal_json.h +++ b/src/plugins/mcusupport/test/armgcc_ek_ra6m3g_baremetal_json.h @@ -45,7 +45,7 @@ constexpr auto armgcc_ek_ra6m3g_baremetal_json = R"( "versionDetection": { "filePattern": "bin/arm-none-eabi-g++", "executableArgs": "--version", - "regex": "\\bv(\\d+\\.\\d+\\.\\d+)\\b" + "regex": "\\b(\\d+\\.\\d+\\.\\d+)\\b" }, "detectionPath": { "windows": "bin/arm-none-eabi-g++.exe", diff --git a/src/plugins/mcusupport/test/armgcc_ek_ra6m3g_freertos_json.h b/src/plugins/mcusupport/test/armgcc_ek_ra6m3g_freertos_json.h index 738cba2f67f..45f7d554284 100644 --- a/src/plugins/mcusupport/test/armgcc_ek_ra6m3g_freertos_json.h +++ b/src/plugins/mcusupport/test/armgcc_ek_ra6m3g_freertos_json.h @@ -45,7 +45,7 @@ constexpr auto armgcc_ek_ra6m3g_freertos_json = R"( "versionDetection": { "filePattern": "bin/arm-none-eabi-g++", "executableArgs": "--version", - "regex": "\\bv(\\d+\\.\\d+\\.\\d+)\\b" + "regex": "\\b(\\d+\\.\\d+\\.\\d+)\\b" }, "detectionPath": { "windows": "bin/arm-none-eabi-g++.exe", diff --git a/src/plugins/mcusupport/test/armgcc_example_baremetal_json.h b/src/plugins/mcusupport/test/armgcc_example_baremetal_json.h index a72af967c6e..e4f10bd54b3 100644 --- a/src/plugins/mcusupport/test/armgcc_example_baremetal_json.h +++ b/src/plugins/mcusupport/test/armgcc_example_baremetal_json.h @@ -30,7 +30,7 @@ constexpr auto armgcc_example_baremetal_json = R"( "versionDetection": { "filePattern": "bin/arm-none-eabi-g++", "executableArgs": "--version", - "regex": "\\bv(\\d+\\.\\d+\\.\\d+)\\b" + "regex": "\\b(\\d+\\.\\d+\\.\\d+)\\b" }, "detectionPath": { "windows": "bin/arm-none-eabi-g++.exe", diff --git a/src/plugins/mcusupport/test/armgcc_mimxrt1050_evk_baremetal_json.h b/src/plugins/mcusupport/test/armgcc_mimxrt1050_evk_baremetal_json.h index 21e154cbde1..01ac942a0a5 100644 --- a/src/plugins/mcusupport/test/armgcc_mimxrt1050_evk_baremetal_json.h +++ b/src/plugins/mcusupport/test/armgcc_mimxrt1050_evk_baremetal_json.h @@ -49,7 +49,7 @@ constexpr auto armgcc_mimxrt1050_evk_baremetal_json = R"( "versionDetection": { "filePattern": "bin/arm-none-eabi-g++", "executableArgs": "--version", - "regex": "\\bv(\\d+\\.\\d+\\.\\d+)\\b" + "regex": "\\b(\\d+\\.\\d+\\.\\d+)\\b" }, "detectionPath": { "windows": "bin/arm-none-eabi-g++.exe", diff --git a/src/plugins/mcusupport/test/armgcc_mimxrt1050_evk_freertos_json.h b/src/plugins/mcusupport/test/armgcc_mimxrt1050_evk_freertos_json.h index b366a3f0167..25e696a14d0 100644 --- a/src/plugins/mcusupport/test/armgcc_mimxrt1050_evk_freertos_json.h +++ b/src/plugins/mcusupport/test/armgcc_mimxrt1050_evk_freertos_json.h @@ -49,7 +49,7 @@ constexpr auto armgcc_mimxrt1050_evk_freertos_json = R"( "versionDetection": { "filePattern": "bin/arm-none-eabi-g++", "executableArgs": "--version", - "regex": "\\bv(\\d+\\.\\d+\\.\\d+)\\b" + "regex": "\\b(\\d+\\.\\d+\\.\\d+)\\b" }, "detectionPath": { "windows": "bin/arm-none-eabi-g++.exe", diff --git a/src/plugins/mcusupport/test/armgcc_mimxrt1060_evk_baremetal_json.h b/src/plugins/mcusupport/test/armgcc_mimxrt1060_evk_baremetal_json.h index efe74d094e7..79c3eb64356 100644 --- a/src/plugins/mcusupport/test/armgcc_mimxrt1060_evk_baremetal_json.h +++ b/src/plugins/mcusupport/test/armgcc_mimxrt1060_evk_baremetal_json.h @@ -48,7 +48,7 @@ constexpr auto armgcc_mimxrt1060_evk_baremetal_json = R"( "versionDetection": { "filePattern": "bin/arm-none-eabi-g++", "executableArgs": "--version", - "regex": "\\bv(\\d+\\.\\d+\\.\\d+)\\b" + "regex": "\\b(\\d+\\.\\d+\\.\\d+)\\b" }, "detectionPath": { "windows": "bin/arm-none-eabi-g++.exe", diff --git a/src/plugins/mcusupport/test/armgcc_mimxrt1064_evk_baremetal_json.h b/src/plugins/mcusupport/test/armgcc_mimxrt1064_evk_baremetal_json.h index e8c71e5292d..b2d4b7ec406 100644 --- a/src/plugins/mcusupport/test/armgcc_mimxrt1064_evk_baremetal_json.h +++ b/src/plugins/mcusupport/test/armgcc_mimxrt1064_evk_baremetal_json.h @@ -49,7 +49,7 @@ constexpr auto armgcc_mimxrt1064_evk_baremetal_json = R"( "versionDetection": { "filePattern": "bin/arm-none-eabi-g++", "executableArgs": "--version", - "regex": "\\bv(\\d+\\.\\d+\\.\\d+)\\b" + "regex": "\\b(\\d+\\.\\d+\\.\\d+)\\b" }, "detectionPath": { "windows": "bin/arm-none-eabi-g++.exe", diff --git a/src/plugins/mcusupport/test/armgcc_mimxrt1064_evk_freertos_json.h b/src/plugins/mcusupport/test/armgcc_mimxrt1064_evk_freertos_json.h index 138a7a56eb7..264ad9c065e 100644 --- a/src/plugins/mcusupport/test/armgcc_mimxrt1064_evk_freertos_json.h +++ b/src/plugins/mcusupport/test/armgcc_mimxrt1064_evk_freertos_json.h @@ -49,7 +49,7 @@ constexpr auto armgcc_mimxrt1064_evk_freertos_json = R"( "versionDetection": { "filePattern": "bin/arm-none-eabi-g++", "executableArgs": "--version", - "regex": "\\bv(\\d+\\.\\d+\\.\\d+)\\b" + "regex": "\\b(\\d+\\.\\d+\\.\\d+)\\b" }, "detectionPath": { "windows": "bin/arm-none-eabi-g++.exe", diff --git a/src/plugins/mcusupport/test/armgcc_mimxrt1170_evk_freertos_json.h b/src/plugins/mcusupport/test/armgcc_mimxrt1170_evk_freertos_json.h index 5aab5105bcb..a32fd7a1dcc 100644 --- a/src/plugins/mcusupport/test/armgcc_mimxrt1170_evk_freertos_json.h +++ b/src/plugins/mcusupport/test/armgcc_mimxrt1170_evk_freertos_json.h @@ -49,7 +49,7 @@ constexpr auto armgcc_mimxrt1170_evk_freertos_json = R"( "versionDetection": { "filePattern": "bin/arm-none-eabi-g++", "executableArgs": "--version", - "regex": "\\bv(\\d+\\.\\d+\\.\\d+)\\b" + "regex": "\\b(\\d+\\.\\d+\\.\\d+)\\b" }, "detectionPath": { "windows": "bin/arm-none-eabi-g++.exe", diff --git a/src/plugins/mcusupport/test/armgcc_stm32f469i_discovery_baremetal_json.h b/src/plugins/mcusupport/test/armgcc_stm32f469i_discovery_baremetal_json.h index d67026d9fef..452ae4e953c 100644 --- a/src/plugins/mcusupport/test/armgcc_stm32f469i_discovery_baremetal_json.h +++ b/src/plugins/mcusupport/test/armgcc_stm32f469i_discovery_baremetal_json.h @@ -48,7 +48,7 @@ constexpr auto armgcc_stm32f469i_discovery_baremetal_json = R"( "versionDetection": { "filePattern": "bin/arm-none-eabi-g++", "executableArgs": "--version", - "regex": "\\bv(\\d+\\.\\d+\\.\\d+)\\b" + "regex": "\\b(\\d+\\.\\d+\\.\\d+)\\b" }, "detectionPath": { "windows": "bin/arm-none-eabi-g++.exe", diff --git a/src/plugins/mcusupport/test/armgcc_stm32f769i_discovery_baremetal_json.h b/src/plugins/mcusupport/test/armgcc_stm32f769i_discovery_baremetal_json.h index c6464c10a75..9fdb309da14 100644 --- a/src/plugins/mcusupport/test/armgcc_stm32f769i_discovery_baremetal_json.h +++ b/src/plugins/mcusupport/test/armgcc_stm32f769i_discovery_baremetal_json.h @@ -48,7 +48,7 @@ constexpr auto armgcc_stm32f769i_discovery_baremetal_json = R"( "versionDetection": { "filePattern": "bin/arm-none-eabi-g++", "executableArgs": "--version", - "regex": "\\bv(\\d+\\.\\d+\\.\\d+)\\b" + "regex": "\\b(\\d+\\.\\d+\\.\\d+)\\b" }, "detectionPath": { "windows": "bin/arm-none-eabi-g++.exe", diff --git a/src/plugins/mcusupport/test/armgcc_stm32f769i_discovery_freertos_json.h b/src/plugins/mcusupport/test/armgcc_stm32f769i_discovery_freertos_json.h index 34da0c65a43..249db9497d5 100644 --- a/src/plugins/mcusupport/test/armgcc_stm32f769i_discovery_freertos_json.h +++ b/src/plugins/mcusupport/test/armgcc_stm32f769i_discovery_freertos_json.h @@ -48,7 +48,7 @@ constexpr auto armgcc_stm32f769i_discovery_freertos_json = R"( "versionDetection": { "filePattern": "bin/arm-none-eabi-g++", "executableArgs": "--version", - "regex": "\\bv(\\d+\\.\\d+\\.\\d+)\\b" + "regex": "\\b(\\d+\\.\\d+\\.\\d+)\\b" }, "detectionPath": { "windows": "bin/arm-none-eabi-g++.exe", diff --git a/src/plugins/mcusupport/test/armgcc_stm32h750b_discovery_baremetal_json.h b/src/plugins/mcusupport/test/armgcc_stm32h750b_discovery_baremetal_json.h index 99aa4cede3f..3b5adc3e989 100644 --- a/src/plugins/mcusupport/test/armgcc_stm32h750b_discovery_baremetal_json.h +++ b/src/plugins/mcusupport/test/armgcc_stm32h750b_discovery_baremetal_json.h @@ -48,7 +48,7 @@ constexpr auto armgcc_stm32h750b_discovery_baremetal_json = R"( "versionDetection": { "filePattern": "bin/arm-none-eabi-g++", "executableArgs": "--version", - "regex": "\\bv(\\d+\\.\\d+\\.\\d+)\\b" + "regex": "\\b(\\d+\\.\\d+\\.\\d+)\\b" }, "detectionPath": { "windows": "bin/arm-none-eabi-g++.exe", diff --git a/src/plugins/mcusupport/test/unittest.cpp b/src/plugins/mcusupport/test/unittest.cpp index 30c0808e077..090ed89cd5c 100644 --- a/src/plugins/mcusupport/test/unittest.cpp +++ b/src/plugins/mcusupport/test/unittest.cpp @@ -75,7 +75,7 @@ using testing::Return; namespace { const char empty[]{""}; const char armGcc[]{"armgcc"}; -const char armGccVersionDetectionRegex[]{R"(\bv(\d+\.\d+\.\d+)\b)"}; +const char armGccVersionDetectionRegex[]{R"(\b(\d+\.\d+\.\d+)\b)"}; const char armGccDir[]{"/opt/armgcc"}; const char armGccDirectorySetting[]{"GNUArmEmbeddedToolchain"}; const char armGccEnvVar[]{"ARMGCC_DIR"}; @@ -1648,7 +1648,7 @@ void McuSupportTest::test_nonemptyVersionDetector() // pkgDesc.validationPath left empty // pkgDesc.versions left empty pkgDesc.versionDetection.filePattern = "bin/arm-none-eabi-g++"; - pkgDesc.versionDetection.regex = "\\bv?(\\d+\\.\\d+\\.\\d+)\\b"; + pkgDesc.versionDetection.regex = "\\b(\\d+\\.\\d+\\.\\d+)\\b"; pkgDesc.versionDetection.executableArgs = "--version"; // pkgDesc.versionDetection.xmlElement left empty // pkgDesc.versionDetection.xmlAttribute left empty