Skip to content

Commit eea78b7

Browse files
committed
test_adfDays2Date: link only tested module, not the whole library.
The tested function is from a private library module, it is not exported by the library, so the module must be linked directly.
1 parent 813d0ec commit eea78b7

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

tests/CMakeLists.txt

+4-2
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@ add_executable ( test_adfPos2DataBlock
4848
test_adfPos2DataBlock.c )
4949

5050
add_executable ( test_adfDays2Date
51-
test_adfDays2Date.c )
51+
test_adfDays2Date.c
52+
${PROJECT_SOURCE_DIR}/src/adf_util.c
53+
)
5254

5355
add_executable ( test_dev_open
5456
test_dev_open.c )
@@ -113,7 +115,7 @@ target_link_libraries ( test_adfPos2DataBlock PUBLIC
113115
)
114116

115117
target_link_libraries ( test_adfDays2Date PUBLIC
116-
adf
118+
# adf
117119
${CHECK_LIBRARIES}
118120
)
119121

tests/Makefile.am

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11

2+
AUTOMAKE_OPTIONS = subdir-objects
3+
24
AM_CPPFLAGS = -std=c99 -Wall -Wextra -pedantic \
35
-Werror-implicit-function-declaration \
46
-I$(top_srcdir)/src -I$(top_srcdir)/src/$(NATIVE_DIR)
@@ -30,7 +32,8 @@ test_adfDays2Date_CFLAGS = $(CHECK_CFLAGS)
3032
test_adfDays2Date_LDADD = $(ADFLIBS) $(CHECK_LIBS)
3133
test_adfDays2Date_DEPENDENCIES = $(top_builddir)/src/libadf.la
3234

33-
test_adfPos2DataBlock_SOURCES = test_adfPos2DataBlock.c
35+
test_adfPos2DataBlock_SOURCES = test_adfPos2DataBlock.c \
36+
$(top_builddir)/src/adf_util.c
3437
test_adfPos2DataBlock_CFLAGS = $(CHECK_CFLAGS)
3538
test_adfPos2DataBlock_LDADD = $(ADFLIBS) $(CHECK_LIBS)
3639
test_adfPos2DataBlock_DEPENDENCIES = $(top_builddir)/src/libadf.la

0 commit comments

Comments
 (0)