From 221648a4f9dde4fc84bb373061809cc435f1aa0b Mon Sep 17 00:00:00 2001 From: Zeex Date: Thu, 6 Sep 2018 15:44:52 +0600 Subject: [PATCH] Rename test executable target to subhook_test and test -> tests --- CMakeLists.txt | 2 +- {test => tests}/.gitignore | 0 {test => tests}/CMakeLists.txt | 18 +++++++++--------- test/build_foo.sh => tests/foo.sh | 2 ++ {test => tests}/foo_32.asm | 0 {test => tests}/foo_64_unix.asm | 0 {test => tests}/foo_64_win.asm | 0 {test => tests}/foo_main.c | 0 {test => tests}/test.c | 0 9 files changed, 12 insertions(+), 10 deletions(-) rename {test => tests}/.gitignore (100%) rename {test => tests}/CMakeLists.txt (79%) rename test/build_foo.sh => tests/foo.sh (98%) rename {test => tests}/foo_32.asm (100%) rename {test => tests}/foo_64_unix.asm (100%) rename {test => tests}/foo_64_win.asm (100%) rename {test => tests}/foo_main.c (100%) rename {test => tests}/test.c (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2b60b26..554eeac 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -86,5 +86,5 @@ include(CTest) if(BUILD_TESTING AND SUBHOOK_TESTS) enable_testing() - add_subdirectory(test) + add_subdirectory(tests) endif() diff --git a/test/.gitignore b/tests/.gitignore similarity index 100% rename from test/.gitignore rename to tests/.gitignore diff --git a/test/CMakeLists.txt b/tests/CMakeLists.txt similarity index 79% rename from test/CMakeLists.txt rename to tests/CMakeLists.txt index a4b9275..1b2514e 100644 --- a/test/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -40,37 +40,37 @@ add_custom_command( MAIN_DEPENDENCY "${CMAKE_CURRENT_SOURCE_DIR}/${asm_file}" ) -add_executable(test_exe +add_executable(subhook_test test.c "${CMAKE_CURRENT_BINARY_DIR}/${asm_file}.obj" ) -set_target_properties(test_exe PROPERTIES OUTPUT_NAME test) +set_target_properties(subhook_test PROPERTIES OUTPUT_NAME test) if(SUBHOOK_FORCE_32BIT) if(APPLE) - set_target_properties(test_exe PROPERTIES OSX_ARCHITECTURES i386) + set_target_properties(subhook_test PROPERTIES OSX_ARCHITECTURES i386) endif() if(UNIX) - set_property(TARGET test_exe APPEND_STRING PROPERTY + set_property(TARGET subhook_test APPEND_STRING PROPERTY COMPILE_FLAGS " -m32") - set_property(TARGET test_exe APPEND_STRING PROPERTY LINK_FLAGS " -m32") + set_property(TARGET subhook_test APPEND_STRING PROPERTY LINK_FLAGS " -m32") endif() endif() -target_link_libraries(test_exe subhook) +target_link_libraries(subhook_test subhook) if(MSVC) - set_property(TARGET test_exe + set_property(TARGET subhook_test APPEND_STRING PROPERTY LINK_FLAGS " /INCREMENTAL:NO") endif() if(APPLE AND CMAKE_SIZEOF_VOID_P EQUAL 8 AND NOT SUBHOOK_FORCE_32BIT) - set_property(TARGET test_exe APPEND_STRING PROPERTY + set_property(TARGET subhook_test APPEND_STRING PROPERTY LINK_FLAGS " -Wl,-no_pie") endif() -add_test(NAME test COMMAND $) +add_test(NAME test COMMAND $) set(expected_output "\ Testing initial install[\r\n]+\ diff --git a/test/build_foo.sh b/tests/foo.sh similarity index 98% rename from test/build_foo.sh rename to tests/foo.sh index 4b13fa5..0f0e940 100644 --- a/test/build_foo.sh +++ b/tests/foo.sh @@ -1,5 +1,7 @@ #!/bin/sh + yasm -f elf64 foo_64_unix.asm gcc -c foo_main.c -o foo_main.o gcc foo_64_unix.o foo_main.o -o foo + ./foo diff --git a/test/foo_32.asm b/tests/foo_32.asm similarity index 100% rename from test/foo_32.asm rename to tests/foo_32.asm diff --git a/test/foo_64_unix.asm b/tests/foo_64_unix.asm similarity index 100% rename from test/foo_64_unix.asm rename to tests/foo_64_unix.asm diff --git a/test/foo_64_win.asm b/tests/foo_64_win.asm similarity index 100% rename from test/foo_64_win.asm rename to tests/foo_64_win.asm diff --git a/test/foo_main.c b/tests/foo_main.c similarity index 100% rename from test/foo_main.c rename to tests/foo_main.c diff --git a/test/test.c b/tests/test.c similarity index 100% rename from test/test.c rename to tests/test.c