Skip to content

Commit

Permalink
Update file path for program scripts
Browse files Browse the repository at this point in the history
This commit updates the file paths necessary for dlopen_demo.sh,
metatest.c query_compile_time_config.c, query_config.h,
query_included_headers.c and zeroize.c.

Signed-off-by: Harry Ramsey <[email protected]>
  • Loading branch information
Harry-Ramsey committed Feb 3, 2025
1 parent 375df83 commit be42c1b
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 15 deletions.
27 changes: 14 additions & 13 deletions programs/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
MBEDTLS_TEST_PATH = ../tests
FRAMEWORK=${MBEDTLS_PATH}/framework
include ../scripts/common.make

ifeq ($(shell uname -s),Linux)
Expand Down Expand Up @@ -77,12 +78,12 @@ APPS = \
ssl/ssl_server \
ssl/ssl_server2 \
test/benchmark \
test/metatest \
test/query_compile_time_config \
test/query_included_headers \
$(FRAMEWORK)/tests/programs/metatest \
$(FRAMEWORK)/tests/programs/query_compile_time_config \
$(FRAMEWORK)/tests/programs/query_included_headers \
test/selftest \
test/udp_proxy \
test/zeroize \
$(FRAMEWORK)/tests/programs/zeroize \
util/pem2der \
util/strerror \
x509/cert_app \
Expand Down Expand Up @@ -301,7 +302,7 @@ ssl/ssl_client1$(EXEXT): ssl/ssl_client1.c $(DEP)

SSL_TEST_OBJECTS = test/query_config.o ssl/ssl_test_lib.o
SSL_TEST_DEPS = $(SSL_TEST_OBJECTS) \
test/query_config.h \
$(FRAMEWORK)/tests/programs/query_config.h \
ssl/ssl_test_lib.h \
ssl/ssl_test_common_source.c \
$(DEP)
Expand All @@ -322,7 +323,7 @@ ssl/ssl_server2$(EXEXT): ssl/ssl_server2.c $(SSL_TEST_DEPS)
echo " CC ssl/ssl_server2.c"
$(CC) $(LOCAL_CFLAGS) $(CFLAGS) ssl/ssl_server2.c $(SSL_TEST_OBJECTS) $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@

ssl/ssl_context_info$(EXEXT): ssl/ssl_context_info.c test/query_config.o test/query_config.h $(DEP)
ssl/ssl_context_info$(EXEXT): ssl/ssl_context_info.c test/query_config.o $(FRAMEWORK)/tests/programs/query_config.h $(DEP)
echo " CC ssl/ssl_context_info.c"
$(CC) $(LOCAL_CFLAGS) $(CFLAGS) ssl/ssl_context_info.c test/query_config.o $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@

Expand Down Expand Up @@ -363,17 +364,17 @@ test/dlopen$(EXEXT): test/dlopen.c $(DEP)
$(CC) $(LOCAL_CFLAGS) $(CFLAGS) test/dlopen.c $(LDFLAGS) $(DLOPEN_LDFLAGS) -o $@
endif

test/metatest$(EXEXT): test/metatest.c $(DEP)
test/metatest$(EXEXT): $(FRAMEWORK)/tests/programs/metatest.c $(DEP)
echo " CC test/metatest.c"
$(CC) $(LOCAL_CFLAGS) $(CFLAGS) -I../library -I../tf-psa-crypto/core test/metatest.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
$(CC) $(LOCAL_CFLAGS) $(CFLAGS) -I../library -I../tf-psa-crypto/core $(FRAMEWORK)/tests/programs/metatest.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@

test/query_config.o: test/query_config.c test/query_config.h $(DEP)
test/query_config.o: test/query_config.c $(FRAMEWORK)/tests/programs/query_config.h $(DEP)
echo " CC test/query_config.c"
$(CC) $(LOCAL_CFLAGS) $(CFLAGS) -c test/query_config.c -o $@

test/query_included_headers$(EXEXT): test/query_included_headers.c $(DEP)
echo " CC test/query_included_headers.c"
$(CC) $(LOCAL_CFLAGS) $(CFLAGS) test/query_included_headers.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
$(CC) $(LOCAL_CFLAGS) $(CFLAGS) $(FRAMEWORK)/tests/programs/query_included_headers.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@

test/selftest$(EXEXT): test/selftest.c $(DEP)
echo " CC test/selftest.c"
Expand All @@ -385,11 +386,11 @@ test/udp_proxy$(EXEXT): test/udp_proxy.c $(DEP)

test/zeroize$(EXEXT): test/zeroize.c $(DEP)
echo " CC test/zeroize.c"
$(CC) $(LOCAL_CFLAGS) $(CFLAGS) test/zeroize.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
$(CC) $(LOCAL_CFLAGS) $(CFLAGS) $(FRAMEWORK)/tests/programs/zeroize.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@

test/query_compile_time_config$(EXEXT): test/query_compile_time_config.c test/query_config.o test/query_config.h $(DEP)
test/query_compile_time_config$(EXEXT): $(FRAMEWORK)/tests/programs/query_compile_time_config.c query_config.o $(FRAMEWORK)/tests/programs/query_config.h $(DEP)
echo " CC test/query_compile_time_config.c"
$(CC) $(LOCAL_CFLAGS) $(CFLAGS) test/query_compile_time_config.c test/query_config.o $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
$(CC) $(LOCAL_CFLAGS) $(CFLAGS) $(FRAMEWORK)/tests/programs/query_compile_time_config.c test/query_config.o $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@

util/pem2der$(EXEXT): util/pem2der.c $(DEP)
echo " CC util/pem2der.c"
Expand Down
6 changes: 6 additions & 0 deletions programs/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ if(USE_SHARED_MBEDTLS_LIBRARY AND
target_link_libraries(dlopen ${CMAKE_DL_LIBS})
endif()

link_to_source(${MBEDTLS_FRAMEWORK_DIR}/tests/programs/metatest.c)
link_to_source(${MBEDTLS_FRAMEWORK_DIR}/tests/programs/query_compile_time_config.c)
link_to_source(${MBEDTLS_FRAMEWORK_DIR}/tests/programs/query_cofig.h)
link_to_source(${MBEDTLS_FRAMEWORK_DIR}/tests/programs/query_included_headers.c)
link_to_source(${MBEDTLS_FRAMEWORK_DIR}/tests/programs/zeroize.c)

if(GEN_FILES)
find_package(Perl REQUIRED)

Expand Down
4 changes: 2 additions & 2 deletions tests/scripts/components-build-system.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ component_test_make_shared () {
msg "build/test: make shared" # ~ 40s
make SHARED=1 TEST_CPP=1 all check
ldd programs/util/strerror | grep libmbedcrypto
programs/test/dlopen_demo.sh
$FRAMEWORK/scripts/dlopen_demo.sh
}

component_test_cmake_shared () {
Expand All @@ -22,7 +22,7 @@ component_test_cmake_shared () {
make
ldd programs/util/strerror | grep libtfpsacrypto
make test
programs/test/dlopen_demo.sh
$FRAMEWORK/scripts/dlopen_demo.sh
}

support_test_cmake_out_of_source () {
Expand Down

0 comments on commit be42c1b

Please sign in to comment.