Skip to content

Commit

Permalink
[TST] Edited test files
Browse files Browse the repository at this point in the history
  • Loading branch information
abdoei committed Nov 9, 2024
1 parent 0dfc759 commit 0daad4b
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/dep.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ jobs:
- name: Run tests
run: |
cd test
./lexer_test
./A_Language_tests
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ add_subdirectory(src)
# Add the GTest directory
add_subdirectory(external/gtest)

# Enable testing if requested
# Enable testing
enable_testing()
add_subdirectory(test)
6 changes: 5 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,8 @@ set(sources
)

# Add the executable
add_executable(A_Language ${sources})
# add_executable(A_Language ${sources})

add_library(A_Language_lib STATIC
${sources}
)
19 changes: 14 additions & 5 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
add_executable(lexer_test lexer_test.cpp)
cmake_minimum_required(VERSION 3.10)

target_link_libraries(lexer_test gtest gtest_main)
set(test A_Language_tests)

add_test(NAME lexer_test COMMAND lexer_test)
set(test_sources
lexer_test.cpp
)

unset(TESTING CACHE)
add_executable(${test} ${test_sources})

target_link_libraries(${test} PUBLIC
gtest_main
A_Language_lib
)

add_test(NAME ${test} COMMAND ${test})

# set the output directory for the test binary
set_target_properties(lexer_test PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${MAINFOLDER}/test")
set_target_properties(${test} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${MAINFOLDER}/test")

0 comments on commit 0daad4b

Please sign in to comment.