summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEgor Yusov <egor.yusov@gmail.com>2019-12-12 05:41:18 +0000
committerEgor Yusov <egor.yusov@gmail.com>2019-12-12 05:41:18 +0000
commit5b2ec830534d32774f6ca7feb2ca086347e91f86 (patch)
tree7caa966ce3a8452d8f489f197cf6129edda9640f
parentFixed c++17 build issue (diff)
downloadDiligentTools-5b2ec830534d32774f6ca7feb2ca086347e91f86.tar.gz
DiligentTools-5b2ec830534d32774f6ca7feb2ca086347e91f86.zip
Added Include test
-rw-r--r--CMakeLists.txt4
-rw-r--r--UnitTests/CMakeLists.txt7
-rw-r--r--UnitTests/IncludeTest/CMakeLists.txt23
-rw-r--r--UnitTests/IncludeTest/TextureLoader/ImageH_test.cpp24
-rw-r--r--UnitTests/IncludeTest/TextureLoader/TextureLoaderH_test.cpp24
-rw-r--r--UnitTests/IncludeTest/TextureLoader/TextureUtilitiesH_test.cpp24
6 files changed, 106 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4584854..6e6812a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -49,6 +49,10 @@ if(PLATFORM_WIN32 AND GL_SUPPORTED)
add_subdirectory(HLSL2GLSLConverter)
endif()
+if(DILIGENT_BUILD_TESTS)
+ add_subdirectory(UnitTests)
+endif()
+
# Installation instructions
if(DILIGENT_INSTALL_TOOLS)
diff --git a/UnitTests/CMakeLists.txt b/UnitTests/CMakeLists.txt
new file mode 100644
index 0000000..d6ecf42
--- /dev/null
+++ b/UnitTests/CMakeLists.txt
@@ -0,0 +1,7 @@
+cmake_minimum_required (VERSION 3.6)
+
+if(TARGET gtest)
+
+endif()
+
+add_subdirectory(IncludeTest)
diff --git a/UnitTests/IncludeTest/CMakeLists.txt b/UnitTests/IncludeTest/CMakeLists.txt
new file mode 100644
index 0000000..ae0b737
--- /dev/null
+++ b/UnitTests/IncludeTest/CMakeLists.txt
@@ -0,0 +1,23 @@
+cmake_minimum_required (VERSION 3.6)
+
+project(DiligentTools-IncludeTest)
+
+file(GLOB_RECURSE SOURCE LIST_DIRECTORIES false *.cpp)
+
+add_library(DiligentTools-IncludeTest ${SOURCE})
+
+target_include_directories(DiligentTools-IncludeTest PRIVATE ../..)
+target_link_libraries(DiligentTools-IncludeTest PRIVATE Diligent-BuildSettings)
+set_common_target_properties(DiligentTools-IncludeTest)
+
+if(MSVC)
+ set_target_properties(DiligentTools-IncludeTest PROPERTIES
+ STATIC_LIBRARY_FLAGS "/IGNORE:4221"
+ )
+endif()
+
+source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${SOURCE})
+
+set_target_properties(DiligentTools-IncludeTest PROPERTIES
+ FOLDER "DiligentTools/Tests"
+)
diff --git a/UnitTests/IncludeTest/TextureLoader/ImageH_test.cpp b/UnitTests/IncludeTest/TextureLoader/ImageH_test.cpp
new file mode 100644
index 0000000..3f8af84
--- /dev/null
+++ b/UnitTests/IncludeTest/TextureLoader/ImageH_test.cpp
@@ -0,0 +1,24 @@
+/* Copyright 2019 Diligent Graphics LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF ANY PROPRIETARY RIGHTS.
+ *
+ * In no event and under no legal theory, whether in tort (including negligence),
+ * contract, or otherwise, unless required by applicable law (such as deliberate
+ * and grossly negligent acts) or agreed to in writing, shall any Contributor be
+ * liable for any damages, including any direct, indirect, special, incidental,
+ * or consequential damages of any character arising as a result of this License or
+ * out of the use or inability to use the software (including but not limited to damages
+ * for loss of goodwill, work stoppage, computer failure or malfunction, or any and
+ * all other commercial damages or losses), even if such Contributor has been advised
+ * of the possibility of such damages.
+ */
+
+#include "TextureLoader/interface/Image.h"
diff --git a/UnitTests/IncludeTest/TextureLoader/TextureLoaderH_test.cpp b/UnitTests/IncludeTest/TextureLoader/TextureLoaderH_test.cpp
new file mode 100644
index 0000000..1e9fe71
--- /dev/null
+++ b/UnitTests/IncludeTest/TextureLoader/TextureLoaderH_test.cpp
@@ -0,0 +1,24 @@
+/* Copyright 2019 Diligent Graphics LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF ANY PROPRIETARY RIGHTS.
+ *
+ * In no event and under no legal theory, whether in tort (including negligence),
+ * contract, or otherwise, unless required by applicable law (such as deliberate
+ * and grossly negligent acts) or agreed to in writing, shall any Contributor be
+ * liable for any damages, including any direct, indirect, special, incidental,
+ * or consequential damages of any character arising as a result of this License or
+ * out of the use or inability to use the software (including but not limited to damages
+ * for loss of goodwill, work stoppage, computer failure or malfunction, or any and
+ * all other commercial damages or losses), even if such Contributor has been advised
+ * of the possibility of such damages.
+ */
+
+#include "TextureLoader/interface/TextureLoader.h"
diff --git a/UnitTests/IncludeTest/TextureLoader/TextureUtilitiesH_test.cpp b/UnitTests/IncludeTest/TextureLoader/TextureUtilitiesH_test.cpp
new file mode 100644
index 0000000..3718338
--- /dev/null
+++ b/UnitTests/IncludeTest/TextureLoader/TextureUtilitiesH_test.cpp
@@ -0,0 +1,24 @@
+/* Copyright 2019 Diligent Graphics LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF ANY PROPRIETARY RIGHTS.
+ *
+ * In no event and under no legal theory, whether in tort (including negligence),
+ * contract, or otherwise, unless required by applicable law (such as deliberate
+ * and grossly negligent acts) or agreed to in writing, shall any Contributor be
+ * liable for any damages, including any direct, indirect, special, incidental,
+ * or consequential damages of any character arising as a result of this License or
+ * out of the use or inability to use the software (including but not limited to damages
+ * for loss of goodwill, work stoppage, computer failure or malfunction, or any and
+ * all other commercial damages or losses), even if such Contributor has been advised
+ * of the possibility of such damages.
+ */
+
+#include "TextureLoader/interface/TextureUtilities.h"