Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacques Lucke <jacques@blender.org>2020-07-26 13:19:11 +0300
committerJacques Lucke <jacques@blender.org>2020-07-26 13:19:11 +0300
commit6cecdf2adec0b824ec49204299b5a04dcdc124d9 (patch)
tree0abfe6ffb4d369f9acc3f79e96a77a0d1be4be4d
parent13abacaaf342b3cff9b29e92f346bee2e5b6e6c4 (diff)
Functions: move tests closer to code
-rw-r--r--source/blender/functions/CMakeLists.txt17
-rw-r--r--source/blender/functions/tests/FN_array_spans_test.cc (renamed from tests/gtests/functions/FN_array_spans_test.cc)4
-rw-r--r--source/blender/functions/tests/FN_attributes_ref_test.cc (renamed from tests/gtests/functions/FN_attributes_ref_test.cc)4
-rw-r--r--source/blender/functions/tests/FN_cpp_type_test.cc (renamed from tests/gtests/functions/FN_cpp_type_test.cc)12
-rw-r--r--source/blender/functions/tests/FN_generic_vector_array_test.cc (renamed from tests/gtests/functions/FN_generic_vector_array_test.cc)4
-rw-r--r--source/blender/functions/tests/FN_multi_function_network_test.cc (renamed from tests/gtests/functions/FN_multi_function_network_test.cc)4
-rw-r--r--source/blender/functions/tests/FN_multi_function_test.cc (renamed from tests/gtests/functions/FN_multi_function_test.cc)4
-rw-r--r--source/blender/functions/tests/FN_spans_test.cc (renamed from tests/gtests/functions/FN_spans_test.cc)4
-rw-r--r--tests/gtests/CMakeLists.txt1
-rw-r--r--tests/gtests/functions/CMakeLists.txt45
10 files changed, 37 insertions, 62 deletions
diff --git a/source/blender/functions/CMakeLists.txt b/source/blender/functions/CMakeLists.txt
index 2686275e898..ad29dbe6668 100644
--- a/source/blender/functions/CMakeLists.txt
+++ b/source/blender/functions/CMakeLists.txt
@@ -57,3 +57,20 @@ set(LIB
)
blender_add_lib(bf_functions "${SRC}" "${INC}" "${INC_SYS}" "${LIB}")
+
+if(WITH_GTESTS)
+ set(TEST_SRC
+ tests/FN_array_spans_test.cc
+ tests/FN_attributes_ref_test.cc
+ tests/FN_cpp_type_test.cc
+ tests/FN_generic_vector_array_test.cc
+ tests/FN_multi_function_network_test.cc
+ tests/FN_multi_function_test.cc
+ tests/FN_spans_test.cc
+ )
+ set (TEST_LIB
+ bf_functions
+ )
+ include(GTestTesting)
+ blender_add_test_lib(bf_functions_tests "${TEST_SRC}" "${INC};${TEST_INC}" "${INC_SYS}" "${LIB};${TEST_LIB}")
+endif()
diff --git a/tests/gtests/functions/FN_array_spans_test.cc b/source/blender/functions/tests/FN_array_spans_test.cc
index 6b7bb8429ff..9a632b58be8 100644
--- a/tests/gtests/functions/FN_array_spans_test.cc
+++ b/source/blender/functions/tests/FN_array_spans_test.cc
@@ -7,7 +7,7 @@
#include "BLI_array.hh"
-namespace blender::fn {
+namespace blender::fn::tests {
TEST(virtual_array_span, EmptyConstructor)
{
@@ -129,4 +129,4 @@ TEST(generic_virtual_array_span, IsSingleArray2)
EXPECT_FALSE(converted.is_single_array());
}
-} // namespace blender::fn
+} // namespace blender::fn::tests
diff --git a/tests/gtests/functions/FN_attributes_ref_test.cc b/source/blender/functions/tests/FN_attributes_ref_test.cc
index 4e618c6d417..3a5e4743c1e 100644
--- a/tests/gtests/functions/FN_attributes_ref_test.cc
+++ b/source/blender/functions/tests/FN_attributes_ref_test.cc
@@ -5,7 +5,7 @@
#include "testing/testing.h"
-namespace blender::fn {
+namespace blender::fn::tests {
TEST(attributes_info, BuildEmpty)
{
@@ -94,4 +94,4 @@ TEST(mutable_attributes_ref, ComplexTest)
EXPECT_EQ(ids[2], 100);
}
-} // namespace blender::fn
+} // namespace blender::fn::tests
diff --git a/tests/gtests/functions/FN_cpp_type_test.cc b/source/blender/functions/tests/FN_cpp_type_test.cc
index 85fc1105c25..29368b251cc 100644
--- a/tests/gtests/functions/FN_cpp_type_test.cc
+++ b/source/blender/functions/tests/FN_cpp_type_test.cc
@@ -4,7 +4,7 @@
#include "FN_cpp_type.hh"
-namespace blender::fn {
+namespace blender::fn::tests {
static const int default_constructed_value = 1;
static const int copy_constructed_value = 2;
@@ -62,7 +62,7 @@ struct TestType {
return stream;
}
- friend bool operator==(const TestType &a, const TestType &b)
+ friend bool operator==(const TestType &UNUSED(a), const TestType &UNUSED(b))
{
return false;
}
@@ -73,7 +73,11 @@ struct TestType {
}
};
-MAKE_CPP_TYPE(TestType, TestType)
+} // namespace blender::fn::tests
+
+MAKE_CPP_TYPE(TestType, blender::fn::tests::TestType)
+
+namespace blender::fn::tests {
const CPPType &CPPType_TestType = CPPType::get<TestType>();
@@ -318,4 +322,4 @@ TEST(cpp_type, DebugPrint)
EXPECT_EQ(text, "42");
}
-} // namespace blender::fn
+} // namespace blender::fn::tests
diff --git a/tests/gtests/functions/FN_generic_vector_array_test.cc b/source/blender/functions/tests/FN_generic_vector_array_test.cc
index cfca678ad27..77ec05f12dc 100644
--- a/tests/gtests/functions/FN_generic_vector_array_test.cc
+++ b/source/blender/functions/tests/FN_generic_vector_array_test.cc
@@ -4,7 +4,7 @@
#include "testing/testing.h"
-namespace blender::fn {
+namespace blender::fn::tests {
TEST(generic_vector_array, Constructor)
{
@@ -98,4 +98,4 @@ TEST(generic_vector_array, Extend)
EXPECT_EQ(ref[0][0], 3);
}
-} // namespace blender::fn
+} // namespace blender::fn::tests
diff --git a/tests/gtests/functions/FN_multi_function_network_test.cc b/source/blender/functions/tests/FN_multi_function_network_test.cc
index 9f16b71bb10..53290e9170c 100644
--- a/tests/gtests/functions/FN_multi_function_network_test.cc
+++ b/source/blender/functions/tests/FN_multi_function_network_test.cc
@@ -6,7 +6,7 @@
#include "FN_multi_function_network.hh"
#include "FN_multi_function_network_evaluation.hh"
-namespace blender::fn {
+namespace blender::fn::tests {
TEST(multi_function_network, Test1)
{
@@ -250,4 +250,4 @@ TEST(multi_function_network, Test2)
}
}
-} // namespace blender::fn
+} // namespace blender::fn::tests
diff --git a/tests/gtests/functions/FN_multi_function_test.cc b/source/blender/functions/tests/FN_multi_function_test.cc
index 8b5fb060c36..6acb6e22b01 100644
--- a/tests/gtests/functions/FN_multi_function_test.cc
+++ b/source/blender/functions/tests/FN_multi_function_test.cc
@@ -5,7 +5,7 @@
#include "FN_multi_function.hh"
#include "FN_multi_function_builder.hh"
-namespace blender::fn {
+namespace blender::fn::tests {
class AddFunction : public MultiFunction {
public:
@@ -382,4 +382,4 @@ TEST(multi_function, CustomMF_Convert)
EXPECT_EQ(outputs[2], 9);
}
-} // namespace blender::fn
+} // namespace blender::fn::tests
diff --git a/tests/gtests/functions/FN_spans_test.cc b/source/blender/functions/tests/FN_spans_test.cc
index 3172cdc7170..527c91d7846 100644
--- a/tests/gtests/functions/FN_spans_test.cc
+++ b/source/blender/functions/tests/FN_spans_test.cc
@@ -4,7 +4,7 @@
#include "FN_spans.hh"
-namespace blender::fn {
+namespace blender::fn::tests {
TEST(generic_span, TypeConstructor)
{
@@ -211,4 +211,4 @@ TEST(generic_virtual_span, SingleConstructor)
EXPECT_EQ(converted[2], 5);
}
-} // namespace blender::fn
+} // namespace blender::fn::tests
diff --git a/tests/gtests/CMakeLists.txt b/tests/gtests/CMakeLists.txt
index 282eb9080f5..9a7509f81f3 100644
--- a/tests/gtests/CMakeLists.txt
+++ b/tests/gtests/CMakeLists.txt
@@ -12,7 +12,6 @@ if(WITH_GTESTS)
add_subdirectory(blenloader)
add_subdirectory(guardedalloc)
add_subdirectory(bmesh)
- add_subdirectory(functions)
if(WITH_CODEC_FFMPEG)
add_subdirectory(ffmpeg)
endif()
diff --git a/tests/gtests/functions/CMakeLists.txt b/tests/gtests/functions/CMakeLists.txt
deleted file mode 100644
index 1246bbd5599..00000000000
--- a/tests/gtests/functions/CMakeLists.txt
+++ /dev/null
@@ -1,45 +0,0 @@
-# ***** BEGIN GPL LICENSE BLOCK *****
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ***** END GPL LICENSE BLOCK *****
-
-set(INC
- .
- ..
- ../../../source/blender/blenlib
- ../../../source/blender/functions
- ../../../source/blender/makesdna
- ../../../intern/guardedalloc
-)
-
-setup_libdirs()
-include_directories(${INC})
-
-
-set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${PLATFORM_LINKFLAGS}")
-set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} ${PLATFORM_LINKFLAGS_DEBUG}")
-
-if(WITH_BUILDINFO)
- set(BUILDINFO buildinfoobj)
-endif()
-
-BLENDER_TEST(FN_array_spans "bf_blenlib;bf_functions;${BUILDINFO}")
-BLENDER_TEST(FN_attributes_ref "bf_blenlib;bf_functions;${BUILDINFO}")
-BLENDER_TEST(FN_cpp_type "bf_blenlib;bf_functions;${BUILDINFO}")
-BLENDER_TEST(FN_generic_vector_array "bf_blenlib;bf_functions;${BUILDINFO}")
-BLENDER_TEST(FN_multi_function "bf_blenlib;bf_functions;${BUILDINFO}")
-BLENDER_TEST(FN_multi_function_network "bf_blenlib;bf_functions;${BUILDINFO}")
-BLENDER_TEST(FN_spans "bf_blenlib;bf_functions;${BUILDINFO}")