Skip to content

Commit

Permalink
Fix build and linking for tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rot127 committed Aug 24, 2024
1 parent 6353661 commit f7e0dd0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
11 changes: 6 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -751,11 +751,6 @@ if(BUILD_SHARED_LIBS)
)
endif()

set(TESTS_INTEGRATION_DIR ${PROJECT_SOURCE_DIR}/tests/integration)
add_subdirectory(${TESTS_INTEGRATION_DIR})
set(TESTS_UNIT_DIR ${PROJECT_SOURCE_DIR}/tests/unit)
add_subdirectory(${TESTS_UNIT_DIR})

# Fuzzer if this is moved to it's own CMakeLists.txt (as it should be)
# the OSS fuzzer build fails. And must be fixed.
# Simply because it builds the fuzzer there again with hard-coded paths.
Expand Down Expand Up @@ -881,6 +876,12 @@ if(CAPSTONE_BUILD_CSTEST)
set(CSTEST_DIR ${PROJECT_SOURCE_DIR}/suite/cstest)
add_subdirectory(${CSTEST_DIR})

# Integration and unit tests
set(TESTS_INTEGRATION_DIR ${PROJECT_SOURCE_DIR}/tests/integration)
add_subdirectory(${TESTS_INTEGRATION_DIR})
set(TESTS_UNIT_DIR ${PROJECT_SOURCE_DIR}/tests/unit)
add_subdirectory(${TESTS_UNIT_DIR})

# Unit tests for auto-sync
set(AUTO_SYNC_C_TEST_DIR ${PROJECT_SOURCE_DIR}/suite/auto-sync/c_tests/)
add_subdirectory(${AUTO_SYNC_C_TEST_DIR})
Expand Down
4 changes: 2 additions & 2 deletions suite/auto-sync/c_tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ include_directories(${AUTO_SYNC_C_TEST_INC_DIR} ${PROJECT_SOURCE_DIR}/include)

file(GLOB AUTO_SYNC_C_SRC ${AUTO_SYNC_C_TEST_SRC_DIR}/*.c)
add_executable(compat_header_build_test ${AUTO_SYNC_C_SRC})
add_dependencies(compat_header_build_test libcstest)
target_link_libraries(compat_header_build_test PUBLIC libcstest)
add_dependencies(compat_header_build_test capstone)
target_link_libraries(compat_header_build_test PUBLIC capstone)

add_test(NAME ASCompatibilityHeaderTest
COMMAND compat_header_build_test
Expand Down

0 comments on commit f7e0dd0

Please sign in to comment.