diff --git a/cmake/FindTests.cmake b/cmake/FindTests.cmake index eeb354d44..3ff9a4387 100644 --- a/cmake/FindTests.cmake +++ b/cmake/FindTests.cmake @@ -1,3 +1,4 @@ +# Copyright (C) 2021 Igara Studio S.A. # Copyright (C) 2001-2016 David Capello # Find tests and add rules to compile them and run them @@ -5,9 +6,6 @@ function(find_tests dir dependencies) file(GLOB tests ${CMAKE_CURRENT_SOURCE_DIR}/${dir}/*_tests.cpp) list(REMOVE_AT ARGV 0) - # Add gtest include directory so we can #include in tests source code - include_directories(${CMAKE_SOURCE_DIR}/third_party/gtest/include) - # See if the test is linked with "laf-os" library. list(FIND dependencies laf-os link_with_os) if(link_with_os) @@ -28,6 +26,13 @@ function(find_tests dir dependencies) target_link_libraries(${testname} gtest ${ARGV} ${PLATFORM_LIBS}) + target_include_directories(${testname} PUBLIC + # So we can include "tests/app_test.h" + ${CMAKE_SOURCE_DIR}/src + # Add gtest include directory so we can #include + # in tests source code + ${CMAKE_SOURCE_DIR}/third_party/gtest/include) + if(extra_definitions) set_target_properties(${testname} PROPERTIES COMPILE_FLAGS ${extra_definitions}) diff --git a/src/app/cli/cli_tests.cpp b/src/app/cli/cli_tests.cpp index d16effeba..506864fd9 100644 --- a/src/app/cli/cli_tests.cpp +++ b/src/app/cli/cli_tests.cpp @@ -5,7 +5,7 @@ // This program is distributed under the terms of // the End-User License Agreement for Aseprite. -#include "tests/test.h" +#include "tests/app_test.h" #include "app/cli/app_options.h" #include "app/cli/cli_processor.h" diff --git a/src/app/cli/filter_layer_tests.cpp b/src/app/cli/filter_layer_tests.cpp index 51299e16c..96d8b5733 100644 --- a/src/app/cli/filter_layer_tests.cpp +++ b/src/app/cli/filter_layer_tests.cpp @@ -4,7 +4,7 @@ // This program is distributed under the terms of // the End-User License Agreement for Aseprite. -#include "tests/test.h" +#include "tests/app_test.h" #include "app/cli/cli_processor.h" #include "doc/layer.h" diff --git a/src/app/color_tests.cpp b/src/app/color_tests.cpp index 0a3a5b4ad..153f07480 100644 --- a/src/app/color_tests.cpp +++ b/src/app/color_tests.cpp @@ -4,7 +4,7 @@ // This program is distributed under the terms of // the End-User License Agreement for Aseprite. -#include "tests/test.h" +#include "tests/app_test.h" #include "app/color.h" diff --git a/src/app/context_tests.cpp b/src/app/context_tests.cpp index b93ac186b..6929dab2c 100644 --- a/src/app/context_tests.cpp +++ b/src/app/context_tests.cpp @@ -4,7 +4,7 @@ // This program is distributed under the terms of // the End-User License Agreement for Aseprite. -#include "tests/test.h" +#include "tests/app_test.h" #include "app/context.h" #include "app/doc.h" diff --git a/src/app/doc_api_tests.cpp b/src/app/doc_api_tests.cpp index e4505f81c..4518c66ff 100644 --- a/src/app/doc_api_tests.cpp +++ b/src/app/doc_api_tests.cpp @@ -5,7 +5,7 @@ // This program is distributed under the terms of // the End-User License Agreement for Aseprite. -#include "tests/test.h" +#include "tests/app_test.h" #include "app/context.h" #include "app/doc.h" diff --git a/src/app/doc_range_tests.cpp b/src/app/doc_range_tests.cpp index a9f07d5cb..eab287aec 100644 --- a/src/app/doc_range_tests.cpp +++ b/src/app/doc_range_tests.cpp @@ -4,7 +4,7 @@ // This program is distributed under the terms of // the End-User License Agreement for Aseprite. -#include "tests/test.h" +#include "tests/app_test.h" #include "app/context.h" #include "app/doc.h" diff --git a/src/app/errno_tests.cpp b/src/app/errno_tests.cpp index ebf7e4b62..153aa31bd 100644 --- a/src/app/errno_tests.cpp +++ b/src/app/errno_tests.cpp @@ -4,7 +4,7 @@ // This program is distributed under the terms of // the End-User License Agreement for Aseprite. -#include "tests/test.h" +#include "tests/app_test.h" #include #include "base/thread.h" diff --git a/src/app/file/file_tests.cpp b/src/app/file/file_tests.cpp index e8f948291..33fb3e391 100644 --- a/src/app/file/file_tests.cpp +++ b/src/app/file/file_tests.cpp @@ -5,7 +5,7 @@ // This program is distributed under the terms of // the End-User License Agreement for Aseprite. -#include "tests/test.h" +#include "tests/app_test.h" #include "app/app.h" #include "app/context.h" diff --git a/src/app/file/split_filename_tests.cpp b/src/app/file/split_filename_tests.cpp index 97aeb321e..4be32614f 100644 --- a/src/app/file/split_filename_tests.cpp +++ b/src/app/file/split_filename_tests.cpp @@ -4,7 +4,7 @@ // This program is distributed under the terms of // the End-User License Agreement for Aseprite. -#include "tests/test.h" +#include "tests/app_test.h" #include "app/file/split_filename.h" diff --git a/src/app/filename_formatter_tests.cpp b/src/app/filename_formatter_tests.cpp index e01371891..5ae2bc708 100644 --- a/src/app/filename_formatter_tests.cpp +++ b/src/app/filename_formatter_tests.cpp @@ -4,7 +4,7 @@ // This program is distributed under the terms of // the End-User License Agreement for Aseprite. -#include "tests/test.h" +#include "tests/app_test.h" #include "app/filename_formatter.h" diff --git a/src/app/ini_file_tests.cpp b/src/app/ini_file_tests.cpp index a8033c5e2..87f0f01f6 100644 --- a/src/app/ini_file_tests.cpp +++ b/src/app/ini_file_tests.cpp @@ -4,7 +4,7 @@ // This program is distributed under the terms of // the End-User License Agreement for Aseprite. -#include "tests/test.h" +#include "tests/app_test.h" #include "app/ini_file.h" #include "base/fs.h" diff --git a/src/clip b/src/clip index 4b8e4cf03..c46c49141 160000 --- a/src/clip +++ b/src/clip @@ -1 +1 @@ -Subproject commit 4b8e4cf03836fb2bd48d64434e6271be7e6ec728 +Subproject commit c46c49141f72dd753b260eea4e6d7b37413f0ff6 diff --git a/src/observable b/src/observable index bddbeed8b..8e03c3cb0 160000 --- a/src/observable +++ b/src/observable @@ -1 +1 @@ -Subproject commit bddbeed8b94d2639fa945bdf14a90d7afbd58506 +Subproject commit 8e03c3cb060120b25517503e6c1d9072686d1cd3 diff --git a/src/tests/test.h b/src/tests/app_test.h similarity index 100% rename from src/tests/test.h rename to src/tests/app_test.h diff --git a/src/ui/accelerator_ui_tests.cpp b/src/ui/accelerator_ui_tests.cpp index 6ad2e13b0..c4d364831 100644 --- a/src/ui/accelerator_ui_tests.cpp +++ b/src/ui/accelerator_ui_tests.cpp @@ -5,7 +5,7 @@ // Read LICENSE.txt for more information. #define TEST_GUI -#include "tests/test.h" +#include "tests/app_test.h" using namespace ui; diff --git a/src/ui/grid_ui_tests.cpp b/src/ui/grid_ui_tests.cpp index 4c53d53f8..0e3c0447e 100644 --- a/src/ui/grid_ui_tests.cpp +++ b/src/ui/grid_ui_tests.cpp @@ -5,7 +5,7 @@ // Read LICENSE.txt for more information. #define TEST_GUI -#include "tests/test.h" +#include "tests/app_test.h" #include "gfx/rect_io.h" #include "gfx/size.h" diff --git a/src/undo b/src/undo index e72730478..3cf8f20d0 160000 --- a/src/undo +++ b/src/undo @@ -1 +1 @@ -Subproject commit e72730478aa6d4dc3be0c914058a7e0561aabe1e +Subproject commit 3cf8f20d08bf38b06b8e0e75757a18e31ddb12d9