feat(cmakev2/kconfig): Added basic test for Kconfig generation

This commit is contained in:
Sudeep Mohanty
2025-11-04 07:48:12 +01:00
committed by Frantisek Hrbata
parent 5235b32232
commit 28c1a64007
+26
View File
@@ -130,12 +130,38 @@ function(test_idf_build_library)
endif()
endfunction()
function(test_kconfig)
# Check that kconfig output files were generated
idf_build_get_property(config_dir CONFIG_DIR)
set(output_files sdkconfig.h sdkconfig.cmake sdkconfig.json kconfig_menus.json)
foreach(file ${output_files})
set(file_path "${config_dir}/${file}")
if(NOT EXISTS "${file_path}")
idf_die("Missing kconfig output: ${file_path}")
endif()
file(SIZE "${file_path}" file_size)
if(file_size EQUAL 0)
idf_die("Empty kconfig output: ${file_path}")
endif()
endforeach()
# Check that kconfig targets were created
set(targets menuconfig confserver save-defconfig)
foreach(target ${targets})
if(NOT TARGET ${target})
idf_die("Missing kconfig target: ${target}")
endif()
endforeach()
endfunction()
# Run tests
test_component_priority()
test_idf_version()
test_python()
test_toolchain()
test_idf_build_library()
test_kconfig()
__dump_all_properties()
message("ALL TESTS PASSED")