1 # build and add test only if tests are enabled
4 -DTEST_DATA_DIR="${CMAKE_CURRENT_SOURCE_DIR}/data/"
5 -DGIT_COMMIT="AppImageKit unit tests"
9 # Link runTests with what we want to test and the GTest and pthread library
10 add_executable(test_libappimage
15 target_link_libraries(test_libappimage
22 add_test(test_libappimage test_libappimage)
25 add_executable(test_shared
28 ${PROJECT_SOURCE_DIR}/src/shared.c
29 ${PROJECT_SOURCE_DIR}/src/elf.c
30 ${PROJECT_SOURCE_DIR}/src/getsection.c
31 ${PROJECT_SOURCE_DIR}/src/appimagetool_shared.c
34 target_link_libraries(test_shared
49 target_include_directories(test_shared
50 # used to include shared.h
51 PRIVATE ${PROJECT_SOURCE_DIR}/src/
52 # need to include libappimage's header directory as well
53 # as we're building this test manually from the source files, we need to replicate the build settings of
54 # libappimage, appimagetool, ...
55 PRIVATE ${PROJECT_SOURCE_DIR}/include/
58 add_test(test_shared test_shared)
60 target_compile_options(test_shared PRIVATE -fpermissive)
63 add_executable(test_getsection
66 ${PROJECT_SOURCE_DIR}/src/light_elf.h
67 ${PROJECT_SOURCE_DIR}/src/light_byteswap.h
68 ${PROJECT_SOURCE_DIR}/src/elf.c
69 ${PROJECT_SOURCE_DIR}/src/getsection.c
72 target_link_libraries(test_getsection
86 target_include_directories(test_getsection
87 # used to include getsection.h
88 PRIVATE ${PROJECT_SOURCE_DIR}/src/
89 # need to include libappimage's header directory as well
90 # as we're building this test manually from the source files, we need to replicate the build settings of
91 # libappimage, appimagetool, ...
92 PRIVATE ${PROJECT_SOURCE_DIR}/include/
96 add_dependencies(test_getsection squashfuse)
98 add_test(test_getsection test_getsection)
100 target_compile_options(test_getsection PRIVATE -fpermissive)