-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #37 from SiliconLabs/test/unit-test-function-post-…
…and-bist Test/unit test function post and bist
- Loading branch information
Showing
24 changed files
with
918 additions
and
147 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
function(generate_lib_iec60730 relative_dir) | ||
|
||
set(FULL_DIR ${CMAKE_SOURCE_DIR}/${relative_dir}) | ||
|
||
execute_process(COMMAND make prepare | ||
WORKING_DIRECTORY ${FULL_DIR}) | ||
|
||
execute_process(COMMAND slc generate -p | ||
${FULL_DIR} -np -d ${FULL_DIR}/src -cpproj -name=lib_iec60730 -o cmake --with ${BOARD_NAME} | ||
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}) | ||
|
||
if (EXISTS ${FULL_DIR}/CMakeLists.txt) | ||
message("-- Path have CMake File: ${FULL_DIR}/CMakeLists.txt") | ||
add_subdirectory(${FULL_DIR}) | ||
else() | ||
message("-- Path don't have CMake File: ${FULL_DIR}") | ||
endif() | ||
endfunction(generate_lib_iec60730) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
|
||
function(generate_unit_test_iec60730_bist relative_dir) | ||
set(FULL_DIR ${CMAKE_SOURCE_DIR}/${relative_dir}) | ||
set(UNIT_TEST_IEC60730_BIST "unit_test_iec60730_bist") | ||
set(UNIT_TEST_IEC60730_BIST_BUILD_DIR "build/unit_test/iec60730_bist") | ||
set(UNIT_TEST_SOURCES | ||
"${FULL_DIR}/src/main.c" | ||
"${FULL_DIR}/src/app.c" | ||
"${FULL_DIR}/src/unit_test_common.c" | ||
"${FULL_DIR}/src/unit_test_iec60730_bist.c" | ||
"${FULL_DIR}/../../lib/src/sl_iec60730_bist.c" | ||
) | ||
set(UNIT_TEST_INCLUDES | ||
"${FULL_DIR}/inc" | ||
${UNITY_HEADER}) | ||
|
||
add_executable(${UNIT_TEST_IEC60730_BIST} ${UNIT_TEST_SOURCES}) | ||
target_include_directories(${UNIT_TEST_IEC60730_BIST} PUBLIC ${UNIT_TEST_INCLUDES}) | ||
target_compile_definitions(${UNIT_TEST_IEC60730_BIST} PUBLIC UNIT_TEST_IEC60730_BIST_ENABLE) | ||
|
||
target_link_libraries(${UNIT_TEST_IEC60730_BIST} PUBLIC unity slc_lib_iec60730) | ||
|
||
# Create .bin, .hex and .s37 artifacts after building the project | ||
add_custom_command(TARGET ${UNIT_TEST_IEC60730_BIST} | ||
POST_BUILD | ||
COMMAND ${CMAKE_OBJCOPY} -O srec "$<TARGET_FILE:${UNIT_TEST_IEC60730_BIST}>" "$<TARGET_FILE_DIR:${UNIT_TEST_IEC60730_BIST}>/$<TARGET_FILE_BASE_NAME:${UNIT_TEST_IEC60730_BIST}>.s37" | ||
COMMAND ${CMAKE_OBJCOPY} -O ihex "$<TARGET_FILE:${UNIT_TEST_IEC60730_BIST}>" "$<TARGET_FILE_DIR:${UNIT_TEST_IEC60730_BIST}>/$<TARGET_FILE_BASE_NAME:${UNIT_TEST_IEC60730_BIST}>.hex" | ||
COMMAND ${CMAKE_OBJCOPY} -O binary "$<TARGET_FILE:${UNIT_TEST_IEC60730_BIST}>" "$<TARGET_FILE_DIR:${UNIT_TEST_IEC60730_BIST}>/$<TARGET_FILE_BASE_NAME:${UNIT_TEST_IEC60730_BIST}>.bin" | ||
COMMAND rm -rf ./build/bist | ||
COMMAND mkdir -p ${UNIT_TEST_IEC60730_BIST_BUILD_DIR} | ||
COMMAND mv ${UNIT_TEST_IEC60730_BIST}.out ${UNIT_TEST_IEC60730_BIST_BUILD_DIR} | ||
COMMAND mv ${UNIT_TEST_IEC60730_BIST}.bin ${UNIT_TEST_IEC60730_BIST_BUILD_DIR} | ||
COMMAND mv ${UNIT_TEST_IEC60730_BIST}.hex ${UNIT_TEST_IEC60730_BIST_BUILD_DIR} | ||
COMMAND mv ${UNIT_TEST_IEC60730_BIST}.s37 ${UNIT_TEST_IEC60730_BIST_BUILD_DIR} | ||
) | ||
|
||
set(post_build_command ${CMAKE_OBJDUMP} -t -h -d -S ${UNIT_TEST_IEC60730_BIST_BUILD_DIR}/${UNIT_TEST_IEC60730_BIST}.out > ${UNIT_TEST_IEC60730_BIST_BUILD_DIR}/${UNIT_TEST_IEC60730_BIST}.lst) | ||
|
||
# Run post-build pipeline to perform additional post-processing | ||
if(post_build_command) | ||
add_custom_command(TARGET ${UNIT_TEST_IEC60730_BIST} | ||
POST_BUILD | ||
COMMAND ${post_build_command} | ||
) | ||
endif() | ||
endfunction(generate_unit_test_iec60730_bist) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
function(generate_unit_test_iec60730_post relative_dir) | ||
set(FULL_DIR ${CMAKE_SOURCE_DIR}/${relative_dir}) | ||
set(UNIT_TEST_IEC60730_POST "unit_test_iec60730_post") | ||
set(UNIT_TEST_IEC60730_POST_BUILD_DIR "build/unit_test/iec60730_post") | ||
set(UNIT_TEST_SOURCES | ||
"${FULL_DIR}/src/main.c" | ||
"${FULL_DIR}/src/app.c" | ||
"${FULL_DIR}/src/unit_test_common.c" | ||
"${FULL_DIR}/src/unit_test_iec60730_post.c" | ||
"${FULL_DIR}/../../lib/src/sl_iec60730_post.c" | ||
) | ||
set(UNIT_TEST_INCLUDES | ||
"${FULL_DIR}/inc" | ||
${UNITY_HEADER}) | ||
|
||
add_executable(${UNIT_TEST_IEC60730_POST} ${UNIT_TEST_SOURCES}) | ||
target_include_directories(${UNIT_TEST_IEC60730_POST} PUBLIC ${UNIT_TEST_INCLUDES}) | ||
target_compile_definitions(${UNIT_TEST_IEC60730_POST} PUBLIC UNIT_TEST_IEC60730_POST_ENABLE) | ||
|
||
target_link_libraries(${UNIT_TEST_IEC60730_POST} PUBLIC unity slc_lib_iec60730) | ||
|
||
# Create .bin, .hex and .s37 artifacts after building the project | ||
add_custom_command(TARGET ${UNIT_TEST_IEC60730_POST} | ||
POST_BUILD | ||
COMMAND ${CMAKE_OBJCOPY} -O srec "$<TARGET_FILE:${UNIT_TEST_IEC60730_POST}>" "$<TARGET_FILE_DIR:${UNIT_TEST_IEC60730_POST}>/$<TARGET_FILE_BASE_NAME:${UNIT_TEST_IEC60730_POST}>.s37" | ||
COMMAND ${CMAKE_OBJCOPY} -O ihex "$<TARGET_FILE:${UNIT_TEST_IEC60730_POST}>" "$<TARGET_FILE_DIR:${UNIT_TEST_IEC60730_POST}>/$<TARGET_FILE_BASE_NAME:${UNIT_TEST_IEC60730_POST}>.hex" | ||
COMMAND ${CMAKE_OBJCOPY} -O binary "$<TARGET_FILE:${UNIT_TEST_IEC60730_POST}>" "$<TARGET_FILE_DIR:${UNIT_TEST_IEC60730_POST}>/$<TARGET_FILE_BASE_NAME:${UNIT_TEST_IEC60730_POST}>.bin" | ||
COMMAND rm -rf ./build/post | ||
COMMAND mkdir -p ${UNIT_TEST_IEC60730_POST_BUILD_DIR} | ||
COMMAND mv ${UNIT_TEST_IEC60730_POST}.out ${UNIT_TEST_IEC60730_POST_BUILD_DIR} | ||
COMMAND mv ${UNIT_TEST_IEC60730_POST}.bin ${UNIT_TEST_IEC60730_POST_BUILD_DIR} | ||
COMMAND mv ${UNIT_TEST_IEC60730_POST}.hex ${UNIT_TEST_IEC60730_POST_BUILD_DIR} | ||
COMMAND mv ${UNIT_TEST_IEC60730_POST}.s37 ${UNIT_TEST_IEC60730_POST_BUILD_DIR} | ||
) | ||
|
||
set(post_build_command ${CMAKE_OBJDUMP} -t -h -d -S ${UNIT_TEST_IEC60730_POST_BUILD_DIR}/${UNIT_TEST_IEC60730_POST}.out > ${UNIT_TEST_IEC60730_POST_BUILD_DIR}/${UNIT_TEST_IEC60730_POST}.lst) | ||
|
||
# Run post-build pipeline to perform additional post-processing | ||
if(post_build_command) | ||
add_custom_command(TARGET ${UNIT_TEST_IEC60730_POST} | ||
POST_BUILD | ||
COMMAND ${post_build_command} | ||
) | ||
endif() | ||
endfunction(generate_unit_test_iec60730_post) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package: iec60730 | ||
description: This components support run unit test function lib IEC60730 | ||
label: IEC60730 Unit Test | ||
quality: test | ||
id: iec60730_unit_test | ||
category: Unit Test | ||
provides: | ||
- name: "iec60730_unit_test" | ||
config_file: | ||
- path: ./lib/config/sl_iec60730_config.h | ||
include: | ||
- path: ./lib/inc | ||
file_list: | ||
- path: coding_standard.h | ||
- path: efr32_iec60730_release_notes.h | ||
- path: sl_iec60730_toolchain.h | ||
- path: sl_iec60730_board.h | ||
- path: sl_iec60730_comm.h | ||
- path: sl_iec60730_cpu_registers.h | ||
- path: sl_iec60730_internal.h | ||
- path: sl_iec60730_invariable_memory.h | ||
- path: sl_iec60730_irq.h | ||
- path: sl_iec60730_library_documentation.h | ||
- path: sl_iec60730_program_counter.h | ||
- path: sl_iec60730_system_clock.h | ||
- path: sl_iec60730_variable_memory.h | ||
- path: sl_iec60730_watchdog.h | ||
- path: sl_iec60730.h | ||
- path: silabs_license_agreement.h | ||
define: | ||
- name: IEC_BOARD_HEADER | ||
value: "\"sl_iec60730_board.h\"" | ||
ui_hints: | ||
visibility: never |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.