Skip to content

Commit 736e954

Browse files
Move shared NBGL source files to OS, where they are compiled
1 parent 1380465 commit 736e954

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+65
-9063
lines changed

.github/workflows/unit_tests.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@ jobs:
2424
run: |
2525
cd unit-tests/lib_standard_app/
2626
cmake -Bbuild -H. && make -C build && make -C build test
27-
cd ../lib_nbgl/
28-
cmake -Bbuild -H. && make -C build && CTEST_OUTPUT_ON_FAILURE=1 make -C build test
29-
STAX=1 cmake -Bbuild -H. && make -C build && CTEST_OUTPUT_ON_FAILURE=1 make -C build test
3027
cd ../app_storage/
3128
cmake -Bbuild -H. && make -C build && make -C build test
3229
cd ../lib_alloc/
@@ -36,8 +33,6 @@ jobs:
3633
run: |
3734
cd unit-tests/lib_standard_app/
3835
../gen_coverage.sh
39-
cd ../lib_nbgl/
40-
../gen_coverage.sh
4136
cd ../app_storage/
4237
../gen_coverage.sh
4338
cd ../lib_alloc/

fuzzing/CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,15 @@ else()
103103
separate_arguments(LINK_FLAGS)
104104
endif()
105105

106+
# NBGL shared library is generated in Bolos, from NBGL sources from Bolos
107+
set(NBGL_SHARED_LIB ../../tests/screenshots/shared_libs/libnbgl_shared_${TARGET}.a)
108+
add_library(nbgl_shared STATIC IMPORTED)
109+
set_target_properties(
110+
nbgl_shared
111+
PROPERTIES
112+
IMPORTED_LOCATION "${CMAKE_CURRENT_LIST_DIR}/shared_libs/libnbgl_shared_${TARGET}.a"
113+
)
114+
106115
# Fuzzing an APP
107116
if(NOT ${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})
108117
file(GLOB LIBS "${BOLOS_SDK}/fuzzing/libs/*.cmake")

fuzzing/extra/apdu_parser.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ target_compile_options(fuzz_apdu_parser PUBLIC ${COMPILATION_FLAGS})
1010
target_link_options(fuzz_apdu_parser PUBLIC ${LINK_FLAGS})
1111

1212
# Link with required libraries
13-
target_link_libraries(fuzz_apdu_parser PUBLIC standard_app)
13+
target_link_libraries(fuzz_apdu_parser PUBLIC standard_app nbgl_shared)

fuzzing/extra/base58.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ target_compile_options(fuzz_base58 PUBLIC ${COMPILATION_FLAGS})
99
target_link_options(fuzz_base58 PUBLIC ${LINK_FLAGS})
1010

1111
# Link with required libraries
12-
target_link_libraries(fuzz_base58 PUBLIC standard_app)
12+
target_link_libraries(fuzz_base58 PUBLIC standard_app nbgl_shared)

fuzzing/extra/bip32.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ target_compile_options(fuzz_bip32 PUBLIC ${COMPILATION_FLAGS})
99
target_link_options(fuzz_bip32 PUBLIC ${LINK_FLAGS})
1010

1111
# Link with required libraries
12-
target_link_libraries(fuzz_bip32 PUBLIC standard_app)
12+
target_link_libraries(fuzz_bip32 PUBLIC standard_app nbgl_shared)

fuzzing/extra/lib_alloc.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ target_compile_options(fuzz_alloc PUBLIC ${COMPILATION_FLAGS})
1212
target_link_options(fuzz_alloc PUBLIC ${LINK_FLAGS})
1313

1414
# Link with required libraries
15-
target_link_libraries(fuzz_alloc PUBLIC alloc nbgl io mock)
15+
target_link_libraries(fuzz_alloc PUBLIC alloc nbgl io mock nbgl_shared)

fuzzing/extra/qrcodegen.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ target_compile_options(fuzz_qrcodegen PUBLIC ${COMPILATION_FLAGS})
1010
target_link_options(fuzz_qrcodegen PUBLIC ${LINK_FLAGS})
1111

1212
# Link with required libraries
13-
target_link_libraries(fuzz_qrcodegen PUBLIC qrcode mock)
13+
target_link_libraries(fuzz_qrcodegen PUBLIC qrcode mock nbgl_shared)

fuzzing/mock/custom/mocks.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11

22
#include <string.h>
33
#include "usbd_core.h"
4+
#include "nbgl_types.h"
5+
6+
unsigned long gLogger;
47

58
size_t strlcpy(char *dst, const char *src, size_t size)
69
{
@@ -31,3 +34,14 @@ uint32_t USBD_LL_GetRxDataSize(USBD_HandleTypeDef *pdev __attribute__((unused)),
3134
{
3235
return 0;
3336
}
37+
38+
void nbgl_frontControlAreaMasking(uint8_t mask_index, nbgl_area_t *masked_area_or_null)
39+
{
40+
(void) mask_index;
41+
(void) masked_area_or_null;
42+
}
43+
44+
void mainExit(int exitCode)
45+
{
46+
(void) exitCode;
47+
}
445 KB
Binary file not shown.
493 KB
Binary file not shown.

0 commit comments

Comments
 (0)