Skip to content

Commit

Permalink
Move GPU LUT files into the tests dir
Browse files Browse the repository at this point in the history
Instead of creating temporary LUT files for GPU tests,
read them from the testdata directory instead.
This removes the need to clean them up after each run.

Signed-off-by: Ananth Bhaskararaman <ananth.b@qubecinema.com>
  • Loading branch information
ananthb committed Oct 16, 2024
1 parent 707734d commit fe2dc94
Show file tree
Hide file tree
Showing 12 changed files with 122 additions and 255 deletions.
8 changes: 4 additions & 4 deletions tests/cpu/Context_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ OCIO_ADD_TEST(Context, use_searchpaths)
const std::string res1 = searchPath1 + "/Context.cpp";
OCIO_CHECK_ASSERT(strcmp(SanitizePath(resolvedSource.c_str()).c_str(),
SanitizePath(res1.c_str()).c_str()) == 0);
OCIO_CHECK_NO_THROW(resolvedSource = context->resolveFileLocation("GPUHelpers.h"));
const std::string res2 = searchPath2 + "/GPUHelpers.h";
OCIO_CHECK_NO_THROW(resolvedSource = context->resolveFileLocation("GPUUnitTest.h"));
const std::string res2 = searchPath2 + "/GPUUnitTest.h";
OCIO_CHECK_ASSERT(strcmp(SanitizePath(resolvedSource.c_str()).c_str(),
SanitizePath(res2.c_str()).c_str()) == 0);
}
Expand All @@ -141,8 +141,8 @@ OCIO_ADD_TEST(Context, use_searchpaths_workingdir)
const std::string res1 = ociodir + "/" + searchPath1 + "/Context.cpp";
OCIO_CHECK_ASSERT(strcmp(SanitizePath(resolvedSource.c_str()).c_str(),
SanitizePath(res1.c_str()).c_str()) == 0);
OCIO_CHECK_NO_THROW(resolvedSource = context->resolveFileLocation("GPUHelpers.h"));
const std::string res2 = ociodir + "/" + searchPath2 + "/GPUHelpers.h";
OCIO_CHECK_NO_THROW(resolvedSource = context->resolveFileLocation("GPUUnitTest.h"));
const std::string res2 = ociodir + "/" + searchPath2 + "/GPUUnitTest.h";
OCIO_CHECK_ASSERT(strcmp(SanitizePath(resolvedSource.c_str()).c_str(),
SanitizePath(res2.c_str()).c_str()) == 0);
}
Expand Down
22 changes: 22 additions & 0 deletions tests/data/files/lut3d_arbitrary.csp
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
CSPLUTV100
3D

2
0.0 1.0
0.0 1.0
2
0.0 1.0
0.0 1.0
2
0.0 1.0
0.0 1.0

2 2 2
0.100000 0.100000 0.100000
1.100000 0.100000 0.100000
0.100000 1.100000 0.100000
1.100000 1.100000 0.100000
0.100000 0.100000 1.100000
1.100000 0.100000 1.100000
0.100000 1.100000 1.100000
1.100000 1.100000 1.100000
22 changes: 22 additions & 0 deletions tests/data/files/lut3d_blu-only.csp
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
CSPLUTV100
3D

2
0.0 1.0
0.0 1.0
2
0.0 1.0
0.0 1.0
2
0.0 1.0
0.0 1.0

2 2 2
0.0 0.0 0.0
0.0 0.0 0.0
0.0 0.0 0.0
0.0 0.0 0.0
0.0 0.0 1.0
0.0 0.0 1.0
0.0 0.0 1.0
0.0 0.0 1.0
22 changes: 22 additions & 0 deletions tests/data/files/lut3d_grn-only.csp
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
CSPLUTV100
3D

2
0.0 1.0
0.0 1.0
2
0.0 1.0
0.0 1.0
2
0.0 1.0
0.0 1.0

2 2 2
0.0 0.0 0.0
0.0 0.0 0.0
0.0 0.0 0.0
0.0 0.0 0.0
0.0 1.0 0.0
0.0 1.0 0.0
0.0 1.0 0.0
0.0 1.0 0.0
22 changes: 22 additions & 0 deletions tests/data/files/lut3d_red-only.csp
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
CSPLUTV100
3D

2
0.0 1.0
0.0 1.0
2
0.0 1.0
0.0 1.0
2
0.0 1.0
0.0 1.0

2 2 2
0.0 0.0 0.0
0.0 0.0 0.0
0.0 0.0 0.0
0.0 0.0 0.0
1.0 0.0 0.0
1.0 0.0 0.0
1.0 0.0 0.0
1.0 0.0 0.0
1 change: 0 additions & 1 deletion tests/gpu/CDLOp_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#include <OpenColorIO/OpenColorIO.h>

#include "GPUUnitTest.h"
#include "GPUHelpers.h"


namespace OCIO = OCIO_NAMESPACE;
Expand Down
1 change: 0 additions & 1 deletion tests/gpu/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ set(SOURCES
ECOp_test.cpp
FixedFunctionOp_test.cpp
GammaOp_test.cpp
GPUHelpers.cpp
GPUUnitTest.cpp
GradingPrimaryOp_test.cpp
GradingRGBCurveOp_test.cpp
Expand Down
58 changes: 0 additions & 58 deletions tests/gpu/GPUHelpers.cpp

This file was deleted.

16 changes: 0 additions & 16 deletions tests/gpu/GPUHelpers.h

This file was deleted.

1 change: 0 additions & 1 deletion tests/gpu/Lut1DOp_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#include <OpenColorIO/OpenColorIO.h>

#include "GPUUnitTest.h"
#include "GPUHelpers.h"

namespace OCIO = OCIO_NAMESPACE;

Expand Down
Loading

0 comments on commit fe2dc94

Please sign in to comment.