add "threads" test to cmake
@@ -145,14 +145,14 @@ endif()
if(BUILD_TESTING)
- #####################
- # hello.hl
-
find_program(
HAXE_COMPILER
haxe
)
+ #####################
+ # hello.hl
+
add_custom_command(OUTPUT ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test/hello.hl
COMMAND ${HAXE_COMPILER}
-hl ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test/hello.hl
@@ -162,37 +162,77 @@ if(BUILD_TESTING)
DEPENDS ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test/hello.hl
)
+ #####################
+ # threads.hl
+
+ add_custom_command(OUTPUT ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test/threads.hl
+ COMMAND ${HAXE_COMPILER}
+ -hl ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test/threads.hl
+ -cp ${CMAKE_SOURCE_DIR}/other/tests -main Threads
+ )
+ add_custom_target(threads.hl ALL
+ DEPENDS ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test/threads.hl
+ )
+
#####################
# hello.c
- add_custom_command(OUTPUT ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test/hello.c
+ add_custom_command(OUTPUT ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test/hello/hello.c
COMMAND ${HAXE_COMPILER}
- -hl ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test/hello.c
+ -hl ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test/hello/hello.c
-cp ${CMAKE_SOURCE_DIR}/other/tests -main HelloWorld
)
add_executable(hello
- ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test/hello.c
+ ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test/hello/hello.c
)
set_target_properties(hello
PROPERTIES
- RUNTIME_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test
+ RUNTIME_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test/hello
)
target_include_directories(hello
- PRIVATE ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test
+ PRIVATE ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test/hello
)
target_link_libraries(hello
libhl
)
+ #####################
+ # threads.c
+
+ add_custom_command(OUTPUT ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test/threads/threads.c
+ COMMAND ${HAXE_COMPILER}
+ -hl ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test/threads/threads.c
+ -cp ${CMAKE_SOURCE_DIR}/other/tests -main Threads
+ )
+ add_executable(threads
+ ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test/threads/threads.c
+ )
+ set_target_properties(threads
+ PROPERTIES
+ RUNTIME_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test/threads
+ )
+ target_include_directories(threads
+ PRIVATE ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test/threads
+ )
+ target_link_libraries(threads
+ libhl
+ )
+
#####################
# Tests
add_test(NAME hello.hl
COMMAND hl ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test/hello.hl
)
+ add_test(NAME threads.hl
+ COMMAND hl ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test/threads.hl
+ )
add_test(NAME hello
COMMAND hello
)
+ add_test(NAME threads
+ COMMAND threads
+ )
add_test(NAME version
COMMAND hl --version
)
