Skip to content

Commit

Permalink
Rename src/tests/test.h -> src/tests/app_test.h to avoid confusion wi…
Browse files Browse the repository at this point in the history
…th observable tests/test.h
  • Loading branch information
dacap committed Dec 24, 2021
1 parent 6836911 commit 02de9be
Show file tree
Hide file tree
Showing 18 changed files with 24 additions and 19 deletions.
11 changes: 8 additions & 3 deletions cmake/FindTests.cmake
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
# Copyright (C) 2021 Igara Studio S.A.
# Copyright (C) 2001-2016 David Capello
# Find tests and add rules to compile them and run them

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 <gtest/gtest.h> 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)
Expand All @@ -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 <gtest/gtest.h>
# in tests source code
${CMAKE_SOURCE_DIR}/third_party/gtest/include)

if(extra_definitions)
set_target_properties(${testname}
PROPERTIES COMPILE_FLAGS ${extra_definitions})
Expand Down
2 changes: 1 addition & 1 deletion src/app/cli/cli_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion src/app/cli/filter_layer_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion src/app/color_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
2 changes: 1 addition & 1 deletion src/app/context_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion src/app/doc_api_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion src/app/doc_range_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion src/app/errno_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <errno.h>
#include "base/thread.h"
Expand Down
2 changes: 1 addition & 1 deletion src/app/file/file_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion src/app/file/split_filename_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
2 changes: 1 addition & 1 deletion src/app/filename_formatter_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
2 changes: 1 addition & 1 deletion src/app/ini_file_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion src/clip
2 changes: 1 addition & 1 deletion src/observable
Submodule observable updated 1 files
+2 −3 CMakeLists.txt
File renamed without changes.
2 changes: 1 addition & 1 deletion src/ui/accelerator_ui_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion src/ui/grid_ui_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
2 changes: 1 addition & 1 deletion src/undo

0 comments on commit 02de9be

Please sign in to comment.