From f6af455f57d13edc5d5c511322a2498474fec4a1 Mon Sep 17 00:00:00 2001 From: Frantisek Hrbata Date: Fri, 31 Mar 2023 09:22:38 +0200 Subject: [PATCH] ci: add build test for sdkconfig specified with abspath On Windows, when path is specified as absolute for cmdl argument, cmake can interpret parts of the path as invalid escape chars. For example "C:\Users\..." will result in "Invalid character escape '\U'." Externally specified paths should be converted into cmake's representation, which uses '/'. This can be done e.g. by using 'get_filename_component()'. Currently there doesn't seem to be any problem with this, but let's add a test for this. Suggested-by: Ivan Grokhotkov Signed-off-by: Frantisek Hrbata --- tools/test_build_system/test_build.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/test_build_system/test_build.py b/tools/test_build_system/test_build.py index 72e03ef5ee..f9e0f3758a 100644 --- a/tools/test_build_system/test_build.py +++ b/tools/test_build_system/test_build.py @@ -133,3 +133,9 @@ def test_build_compiler_flags_no_overwriting(idf_py: IdfPyFunc) -> None: # If the compiler flags are overriden, the following build command will # cause issues at link time. idf_py('build', '-DCMAKE_C_FLAGS=', '-DCMAKE_CXX_FLAGS=') + + +def test_build_with_sdkconfig_build_abspath(idf_py: IdfPyFunc, test_app_copy: Path) -> None: + build_path = test_app_copy / 'build_tmp' + sdkconfig_path = build_path / 'sdkconfig' + idf_py('-D', f'SDKCONFIG={sdkconfig_path}', '-B', str(build_path), 'build')