Browse Source

Reduced dependencies for tests to compile them faster.

David Piuva 9 months ago
parent
commit
c05defbca8

+ 3 - 2
Source/test/testTools.h

@@ -1,8 +1,9 @@
 #ifndef TEST_TOOLS
 #define TEST_TOOLS
 
-// TODO: Make it faster to crawl source by only including what is needed by the test.
-#include "../DFPSR/includeFramework.h"
+#include "../DFPSR/includeEssentials.h"
+#include "../DFPSR/api/algorithmAPI.h"
+#include "../DFPSR/math/FVector.h"
 #include <cstdlib>
 #include <csignal>
 

+ 1 - 0
Source/test/tests/ArrayTest.cpp

@@ -1,5 +1,6 @@
 
 #include "../testTools.h"
+#include "../../DFPSR/collection/Array.h"
 
 START_TEST(Array)
 	{

+ 1 - 0
Source/test/tests/BufferTest.cpp

@@ -1,5 +1,6 @@
 
 #include "../testTools.h"
+#include "../../DFPSR/api/bufferAPI.h"
 
 START_TEST(Buffer)
 	{

+ 2 - 0
Source/test/tests/DrawTest.cpp

@@ -1,5 +1,7 @@
 
 #include "../testTools.h"
+#include "../../DFPSR/api/imageAPI.h"
+#include "../../DFPSR/api/drawAPI.h"
 
 START_TEST(Draw)
 	// Resources

+ 1 - 0
Source/test/tests/FieldTest.cpp

@@ -1,5 +1,6 @@
 
 #include "../testTools.h"
+#include "../../DFPSR/collection/Field.h"
 
 START_TEST(Field)
 	{

+ 1 - 0
Source/test/tests/FileTest.cpp

@@ -1,6 +1,7 @@
 
 #define NO_IMPLICIT_PATH_SYNTAX
 #include "../testTools.h"
+#include "../../DFPSR/api/fileAPI.h"
 
 START_TEST(File)
 	{ // Combining paths

+ 2 - 0
Source/test/tests/ImageProcessingTest.cpp

@@ -1,5 +1,7 @@
 
 #include "../testTools.h"
+#include "../../DFPSR/api/imageAPI.h"
+#include "../../DFPSR/api/filterAPI.h"
 #include "../../DFPSR/base/simd.h"
 
 AlignedImageU8 addImages_generate(ImageU8 imageA, ImageU8 imageB) {

+ 1 - 0
Source/test/tests/ImageTest.cpp

@@ -1,5 +1,6 @@
 
 #include "../testTools.h"
+#include "../../DFPSR/api/imageAPI.h"
 
 START_TEST(Image)
 	{ // ImageU8

+ 1 - 0
Source/test/tests/ListTest.cpp

@@ -1,5 +1,6 @@
 
 #include "../testTools.h"
+#include "../../DFPSR/collection/List.h"
 
 static void targetByReference(List<int32_t> &target, int32_t value) {
 	target.push(value);

+ 1 - 0
Source/test/tests/PixelTest.cpp

@@ -1,5 +1,6 @@
 
 #include "../testTools.h"
+#include "../../DFPSR/api/imageAPI.h"
 
 START_TEST(Pixel)
 	{ // ImageU8

+ 1 - 0
Source/test/tests/SafePointerTest.cpp

@@ -1,5 +1,6 @@
 
 #include "../testTools.h"
+#include "../../DFPSR/base/SafePointer.h"
 
 START_TEST(SafePointer)
 	// Simulate unaligned memory

+ 1 - 0
Source/test/tests/SimdTest.cpp

@@ -1,6 +1,7 @@
 
 #include "../testTools.h"
 #include "../../DFPSR/base/simd.h"
+#include "../../DFPSR/base/endian.h"
 
 // TODO: Test: allLanesNotEqual, allLanesLesser, allLanesGreater, allLanesLesserOrEqual, allLanesGreaterOrEqual, operand ~, smaller bit shifts.
 // TODO: Test that truncateToU32 saturates to minimum and maximum values.

+ 1 - 3
Source/test/tests/StringTest.cpp

@@ -1,9 +1,7 @@
 
 #include "../testTools.h"
+#include "../../DFPSR/api/stringAPI.h"
 
-// TODO: Cannot use casting to parent type at the same time as automatic conversion from const char*
-//       Cover everything using a single dsr::String type?
-//       Use "" operand as only constructor?
 void fooInPlace(dsr::String& target, const dsr::ReadableString& a, const dsr::ReadableString& b) {
 	string_clear(target);
 	string_append(target, U"Foo(");

+ 1 - 0
Source/test/tests/TextEncodingTest.cpp

@@ -1,5 +1,6 @@
 
 #include "../testTools.h"
+#include "../../DFPSR/api/stringAPI.h"
 
 // These tests will fail if the source code document or stored files change their encoding of line breaks.
 

+ 1 - 0
Source/test/tests/TextureTest.cpp

@@ -2,6 +2,7 @@
 #include "../testTools.h"
 #include "../../DFPSR/base/simd.h"
 #include "../../DFPSR/implementation/image/PackOrder.h"
+#include "../../DFPSR/api/textureAPI.h"
 
 #define ASSERT_EQUAL_SIMD(A, B) ASSERT_COMP(A, B, allLanesEqual, "==")
 #define ASSERT_NOTEQUAL_SIMD(A, B) ASSERT_COMP(A, B, !allLanesEqual, "!=")

+ 4 - 0
Source/test/tests/VectorTest.cpp

@@ -1,5 +1,9 @@
 
 #include "../testTools.h"
+#include "../../DFPSR/math/UVector.h"
+#include "../../DFPSR/math/IVector.h"
+#include "../../DFPSR/math/LVector.h"
+#include "../../DFPSR/math/FVector.h"
 
 START_TEST(Vector)
 	// Comparisons