add_custom_target(tests)
add_dependencies(tests test_miscasm test_face test_rect test_fading test_lcw test_xordelta test_irandom test_fatpixel test_tobuff test_drawline test_putpixel test_drawbuff)

add_executable(test_miscasm miscasm.cpp)
target_include_directories(test_miscasm PUBLIC .. ../common)
target_compile_definitions(test_miscasm PUBLIC TRUE_FALSE_DEFINED ENGLISH $<$<CONFIG:DEBUG>:_DEBUG> _WINDOWS _CRT_SECURE_NO_DEPRECATE _CRT_NONSTDC_NO_DEPRECATE WINSOCK_IPX)
target_link_libraries(test_miscasm PUBLIC common ${STATIC_LIBS})
add_test(NAME miscasm COMMAND ${TARGET_SYSTEM_EMULATOR} $<TARGET_FILE:test_miscasm>)

add_executable(test_face face.cpp)
target_include_directories(test_face PUBLIC .. ../common)
target_compile_definitions(test_face PUBLIC TRUE_FALSE_DEFINED ENGLISH $<$<CONFIG:DEBUG>:_DEBUG> _WINDOWS _CRT_SECURE_NO_DEPRECATE _CRT_NONSTDC_NO_DEPRECATE WINSOCK_IPX)
target_link_libraries(test_face PUBLIC common ${STATIC_LIBS})
add_test(NAME face COMMAND ${TARGET_SYSTEM_EMULATOR} $<TARGET_FILE:test_face>)

add_executable(test_rect rect.cpp)
target_include_directories(test_rect PUBLIC .. ../common)
target_compile_definitions(test_rect PUBLIC TRUE_FALSE_DEFINED ENGLISH $<$<CONFIG:DEBUG>:_DEBUG> _WINDOWS _CRT_SECURE_NO_DEPRECATE _CRT_NONSTDC_NO_DEPRECATE WINSOCK_IPX)
target_link_libraries(test_rect PUBLIC common ${STATIC_LIBS})
add_test(NAME rect COMMAND ${TARGET_SYSTEM_EMULATOR} $<TARGET_FILE:test_rect>)

add_executable(test_fading fading.cpp)
target_include_directories(test_fading PUBLIC .. ../common)
target_compile_definitions(test_fading PUBLIC TRUE_FALSE_DEFINED ENGLISH $<$<CONFIG:DEBUG>:_DEBUG> _WINDOWS _CRT_SECURE_NO_DEPRECATE _CRT_NONSTDC_NO_DEPRECATE WINSOCK_IPX)
target_link_libraries(test_fading PUBLIC common ${STATIC_LIBS})
add_test(NAME fading COMMAND ${TARGET_SYSTEM_EMULATOR} $<TARGET_FILE:test_fading>)

add_executable(test_lcw lcw.cpp)
target_include_directories(test_lcw PUBLIC .. ../common)
target_compile_definitions(test_lcw PUBLIC TRUE_FALSE_DEFINED ENGLISH $<$<CONFIG:DEBUG>:_DEBUG> _WINDOWS _CRT_SECURE_NO_DEPRECATE _CRT_NONSTDC_NO_DEPRECATE WINSOCK_IPX)
target_link_libraries(test_lcw PUBLIC common ${STATIC_LIBS})
add_test(NAME lcw COMMAND ${TARGET_SYSTEM_EMULATOR} $<TARGET_FILE:test_lcw>)

add_executable(test_xordelta xordelta.cpp)
target_include_directories(test_xordelta PUBLIC .. ../common)
target_compile_definitions(test_xordelta PUBLIC TRUE_FALSE_DEFINED ENGLISH $<$<CONFIG:DEBUG>:_DEBUG> _WINDOWS _CRT_SECURE_NO_DEPRECATE _CRT_NONSTDC_NO_DEPRECATE WINSOCK_IPX)
target_link_libraries(test_xordelta PUBLIC common ${STATIC_LIBS})
add_test(NAME xordelta COMMAND ${TARGET_SYSTEM_EMULATOR} $<TARGET_FILE:test_xordelta>)

add_executable(test_irandom irandom.cpp)
target_include_directories(test_irandom PUBLIC .. ../common)
target_compile_definitions(test_irandom PUBLIC TRUE_FALSE_DEFINED ENGLISH $<$<CONFIG:DEBUG>:_DEBUG> _WINDOWS _CRT_SECURE_NO_DEPRECATE _CRT_NONSTDC_NO_DEPRECATE WINSOCK_IPX)
target_link_libraries(test_irandom PUBLIC common ${STATIC_LIBS})
add_test(NAME irandom COMMAND ${TARGET_SYSTEM_EMULATOR} $<TARGET_FILE:test_irandom>)

add_executable(test_fatpixel fatpixel.cpp)
target_include_directories(test_fatpixel PUBLIC .. ../common)
target_compile_definitions(test_fatpixel PUBLIC TRUE_FALSE_DEFINED ENGLISH $<$<CONFIG:DEBUG>:_DEBUG> _WINDOWS _CRT_SECURE_NO_DEPRECATE _CRT_NONSTDC_NO_DEPRECATE WINSOCK_IPX)
target_link_libraries(test_fatpixel PUBLIC commonv ${STATIC_LIBS})
add_test(NAME fatpixel COMMAND ${TARGET_SYSTEM_EMULATOR} $<TARGET_FILE:test_fatpixel>)

add_executable(test_tobuff tobuff.cpp)
target_include_directories(test_tobuff PUBLIC .. ../common)
target_compile_definitions(test_tobuff PUBLIC TRUE_FALSE_DEFINED ENGLISH $<$<CONFIG:DEBUG>:_DEBUG> _WINDOWS _CRT_SECURE_NO_DEPRECATE _CRT_NONSTDC_NO_DEPRECATE WINSOCK_IPX)
target_link_libraries(test_tobuff PUBLIC commonv ${STATIC_LIBS})
add_test(NAME tobuff COMMAND ${TARGET_SYSTEM_EMULATOR} $<TARGET_FILE:test_tobuff>)

add_executable(test_drawline drawline.cpp)
target_include_directories(test_drawline PUBLIC .. ../common)
target_compile_definitions(test_drawline PUBLIC TRUE_FALSE_DEFINED ENGLISH $<$<CONFIG:DEBUG>:_DEBUG> _WINDOWS _CRT_SECURE_NO_DEPRECATE _CRT_NONSTDC_NO_DEPRECATE WINSOCK_IPX)
target_link_libraries(test_drawline PUBLIC commonv ${STATIC_LIBS})
add_test(NAME drawline COMMAND ${TARGET_SYSTEM_EMULATOR} $<TARGET_FILE:test_drawline>)

add_executable(test_putpixel putpixel.cpp)
target_include_directories(test_putpixel PUBLIC .. ../common)
target_compile_definitions(test_putpixel PUBLIC TRUE_FALSE_DEFINED ENGLISH $<$<CONFIG:DEBUG>:_DEBUG> _WINDOWS _CRT_SECURE_NO_DEPRECATE _CRT_NONSTDC_NO_DEPRECATE WINSOCK_IPX)
target_link_libraries(test_putpixel PUBLIC commonv ${STATIC_LIBS})
add_test(NAME putpixel COMMAND ${TARGET_SYSTEM_EMULATOR} $<TARGET_FILE:test_putpixel>)

add_executable(test_drawbuff drawbuff.cpp)
target_include_directories(test_drawbuff PUBLIC .. ../common)
target_compile_definitions(test_drawbuff PUBLIC TRUE_FALSE_DEFINED ENGLISH $<$<CONFIG:DEBUG>:_DEBUG> _WINDOWS _CRT_SECURE_NO_DEPRECATE _CRT_NONSTDC_NO_DEPRECATE WINSOCK_IPX)
target_link_libraries(test_drawbuff PUBLIC commonv ${STATIC_LIBS})
add_test(NAME drawbuff COMMAND ${TARGET_SYSTEM_EMULATOR} $<TARGET_FILE:test_drawbuff>)
