From 3f198dfa0eaa1e141a8fabac7254772fdabce175 Mon Sep 17 00:00:00 2001 From: Carlos Medeiros Date: Wed, 6 Mar 2024 11:05:34 +0000 Subject: [PATCH] add compilation flag for textual --- CMakeLists.txt | 1 + app/Makefile | 4 ++++ tests_zemu/tests/textual.test.ts | 24 ++++++++++++++++++++++++ 3 files changed, 29 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2b45a519..bd698708 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -151,6 +151,7 @@ target_link_libraries(unittests PRIVATE add_compile_definitions(TESTVECTORS_DIR="${CMAKE_CURRENT_SOURCE_DIR}/tests/") add_compile_definitions(APP_TESTING=1) +add_compile_definitions(COMPILE_TEXTUAL=1) add_test(unittests ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittests) set_tests_properties(unittests PROPERTIES WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/tests) diff --git a/app/Makefile b/app/Makefile index a18cb1b7..946673a5 100755 --- a/app/Makefile +++ b/app/Makefile @@ -61,6 +61,10 @@ ifndef ICONNAME $(error ICONNAME is not set) endif +ifneq ($(TARGET_NAME),TARGET_NANOS) + CFLAGS += -DCOMPILE_TEXTUAL +endif + include $(CURDIR)/../deps/ledger-zxlib/makefiles/Makefile.platform CFLAGS += -I$(MY_DIR)/../deps/tinycbor/src APP_SOURCE_PATH += $(MY_DIR)/../deps/tinycbor-ledger diff --git a/tests_zemu/tests/textual.test.ts b/tests_zemu/tests/textual.test.ts index 96532027..13b96dcf 100644 --- a/tests_zemu/tests/textual.test.ts +++ b/tests_zemu/tests/textual.test.ts @@ -29,6 +29,10 @@ jest.setTimeout(90000) describe('Textual', function () { // eslint-disable-next-line jest/expect-expect test.concurrent.each(DEVICE_MODELS)('can start and stop container', async function (m) { + if (m.name === 'nanos') { + // Skip the test for the nanos device + return; + } const sim = new Zemu(m.path) try { await sim.start({ ...defaultOptions, model: m.name }) @@ -38,6 +42,10 @@ describe('Textual', function () { }) test.concurrent.each(DEVICE_MODELS)('sign basic textual', async function (m) { + if (m.name === 'nanos') { + // Skip the test for the nanos device + return; + } const sim = new Zemu(m.path) try { await sim.start({ ...defaultOptions, model: m.name }) @@ -84,6 +92,10 @@ describe('Textual', function () { }) test.concurrent.each(DEVICE_MODELS)('sign basic textual expert', async function (m) { + if (m.name === 'nanos') { + // Skip the test for the nanos device + return; + } const sim = new Zemu(m.path) try { await sim.start({ ...defaultOptions, model: m.name }) @@ -133,6 +145,10 @@ describe('Textual', function () { }) test.concurrent.each(DEVICE_MODELS)('sign basic textual eth ', async function (m) { + if (m.name === 'nanos') { + // Skip the test for the nanos device + return; + } const sim = new Zemu(m.path) try { await sim.start({ ...defaultOptions, model: m.name }) @@ -182,6 +198,10 @@ describe('Textual', function () { }) test.concurrent.each(DEVICE_MODELS)('sign basic textual eth warning ', async function (m) { + if (m.name === 'nanos') { + // Skip the test for the nanos device + return; + } const sim = new Zemu(m.path) try { await sim.start({ ...defaultOptions, model: m.name }) @@ -228,6 +248,10 @@ describe('Textual', function () { }) test.concurrent.each(DEVICE_MODELS)('sign basic textual evmos ', async function (m) { + if (m.name === 'nanos') { + // Skip the test for the nanos device + return; + } const sim = new Zemu(m.path) try { await sim.start({ ...defaultOptions, model: m.name })