From e47d3602f89b514be303f1840e61022a118a0934 Mon Sep 17 00:00:00 2001 From: John Haddon Date: Mon, 24 Jul 2023 11:26:31 +0100 Subject: [PATCH 1/5] Tests : Don't include `boost/test/floating_point_comparison.hpp` This header is deprecated, and should be replaced with `boost/test/tools/floating_point_comparison.hpp`. But that doesn't seem to be necessary for the tests to compile or to pass, so I have simply removed the includes. --- test/IECore/DataConversionTest.h | 1 - test/IECore/DataConvertTest.h | 2 -- test/IECore/DespatchTypedDataTest.h | 2 -- test/IECore/IndexedIOTest.h | 2 -- test/IECore/InterpolatorTest.h | 2 -- test/IECore/LevenbergMarquardtTest.inl | 1 - test/IECore/RadixSortTest.h | 1 - test/IECore/SpaceTransformTest.h | 2 -- test/IECore/SweepAndPruneTest.h | 1 - 9 files changed, 14 deletions(-) diff --git a/test/IECore/DataConversionTest.h b/test/IECore/DataConversionTest.h index dce6c80aff..ec5ed4a3ed 100644 --- a/test/IECore/DataConversionTest.h +++ b/test/IECore/DataConversionTest.h @@ -46,7 +46,6 @@ IECORE_PUSH_DEFAULT_VISIBILITY IECORE_POP_DEFAULT_VISIBILITY #include "boost/random.hpp" -#include "boost/test/floating_point_comparison.hpp" #include diff --git a/test/IECore/DataConvertTest.h b/test/IECore/DataConvertTest.h index e03cda9c52..0e4d06d9b9 100644 --- a/test/IECore/DataConvertTest.h +++ b/test/IECore/DataConvertTest.h @@ -44,8 +44,6 @@ IECORE_PUSH_DEFAULT_VISIBILITY #include "boost/test/unit_test.hpp" IECORE_POP_DEFAULT_VISIBILITY -#include "boost/test/floating_point_comparison.hpp" - #include namespace IECore diff --git a/test/IECore/DespatchTypedDataTest.h b/test/IECore/DespatchTypedDataTest.h index d47a021eef..1e2d0ba638 100644 --- a/test/IECore/DespatchTypedDataTest.h +++ b/test/IECore/DespatchTypedDataTest.h @@ -45,8 +45,6 @@ IECORE_PUSH_DEFAULT_VISIBILITY #include "boost/test/unit_test.hpp" IECORE_POP_DEFAULT_VISIBILITY -#include "boost/test/floating_point_comparison.hpp" - #include using namespace Imath; diff --git a/test/IECore/IndexedIOTest.h b/test/IECore/IndexedIOTest.h index 4c895d34ac..e9293da541 100755 --- a/test/IECore/IndexedIOTest.h +++ b/test/IECore/IndexedIOTest.h @@ -43,8 +43,6 @@ IECORE_PUSH_DEFAULT_VISIBILITY #include "boost/test/unit_test.hpp" IECORE_POP_DEFAULT_VISIBILITY -#include "boost/test/floating_point_comparison.hpp" - #include #include #include diff --git a/test/IECore/InterpolatorTest.h b/test/IECore/InterpolatorTest.h index 7c47d9c7ad..e9b6c6d874 100644 --- a/test/IECore/InterpolatorTest.h +++ b/test/IECore/InterpolatorTest.h @@ -49,8 +49,6 @@ IECORE_PUSH_DEFAULT_VISIBILITY #include "boost/test/unit_test.hpp" IECORE_POP_DEFAULT_VISIBILITY -#include "boost/test/floating_point_comparison.hpp" - namespace IECore { void addInterpolatorTest(boost::unit_test::test_suite* test); diff --git a/test/IECore/LevenbergMarquardtTest.inl b/test/IECore/LevenbergMarquardtTest.inl index 67217dffc8..890ef3b0db 100644 --- a/test/IECore/LevenbergMarquardtTest.inl +++ b/test/IECore/LevenbergMarquardtTest.inl @@ -36,7 +36,6 @@ #include "OpenEXR/ImathRandom.h" #include "boost/math/tools/rational.hpp" -#include "boost/test/floating_point_comparison.hpp" using namespace IECore; using namespace Imath; diff --git a/test/IECore/RadixSortTest.h b/test/IECore/RadixSortTest.h index 8ff5b3c264..ec34ebb21d 100644 --- a/test/IECore/RadixSortTest.h +++ b/test/IECore/RadixSortTest.h @@ -44,7 +44,6 @@ IECORE_PUSH_DEFAULT_VISIBILITY IECORE_POP_DEFAULT_VISIBILITY #include "boost/random.hpp" -#include "boost/test/floating_point_comparison.hpp" #include #include diff --git a/test/IECore/SpaceTransformTest.h b/test/IECore/SpaceTransformTest.h index 62b7df0539..4ff5a1e9d1 100644 --- a/test/IECore/SpaceTransformTest.h +++ b/test/IECore/SpaceTransformTest.h @@ -49,8 +49,6 @@ IECORE_PUSH_DEFAULT_VISIBILITY #include "boost/test/unit_test.hpp" IECORE_POP_DEFAULT_VISIBILITY -#include "boost/test/floating_point_comparison.hpp" - #include #include diff --git a/test/IECore/SweepAndPruneTest.h b/test/IECore/SweepAndPruneTest.h index d07fc80c21..e05c9cc3d7 100644 --- a/test/IECore/SweepAndPruneTest.h +++ b/test/IECore/SweepAndPruneTest.h @@ -52,7 +52,6 @@ IECORE_PUSH_DEFAULT_VISIBILITY IECORE_POP_DEFAULT_VISIBILITY #include "boost/random.hpp" -#include "boost/test/floating_point_comparison.hpp" #include #include From 9bd2351ad2ba3140b15d0e444afa8487dc7d6fca Mon Sep 17 00:00:00 2001 From: John Haddon Date: Mon, 24 Jul 2023 11:41:57 +0100 Subject: [PATCH 2/5] LevenbergMarquardtTest : Replace `boost::array` with regular array In Boost 1.77, `evaluate_polynomial` stopped supporting `boost::array`, and started supporting `std::array` instead. We'd prefer to use `std::array` too, but to maintain compatibility with both old and new boost, we just use a plain old array instead. --- test/IECore/LevenbergMarquardtTest.inl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/IECore/LevenbergMarquardtTest.inl b/test/IECore/LevenbergMarquardtTest.inl index 890ef3b0db..63d9b30261 100644 --- a/test/IECore/LevenbergMarquardtTest.inl +++ b/test/IECore/LevenbergMarquardtTest.inl @@ -136,7 +136,7 @@ class LevenbergMarquardtTestPolynomialFit::Fn ) { - boost::array testCoeffs; + T testCoeffs[N]; for ( unsigned i = 0; i < N; i ++ ) { testCoeffs[i] = parameters->readable()[i]; @@ -170,7 +170,7 @@ class LevenbergMarquardtTestPolynomialFit::Fn protected : unsigned m_num; - boost::array m_coeffs; + T m_coeffs[N]; }; template From f64c2930eb1f4b9fccd9c47561fb7cbbbf7a1cce Mon Sep 17 00:00:00 2001 From: John Haddon Date: Mon, 24 Jul 2023 11:52:52 +0100 Subject: [PATCH 3/5] Tests : Adapt for OpenEXR/Imath 3 --- test/IECore/CompilerTest.h | 10 ++++++++-- test/IECore/IECoreTest.cpp | 5 +++++ test/IECore/InternedStringTest.cpp | 5 +++++ test/IECore/InterpolatorTest.h | 9 ++++++++- test/IECore/KDTreeTest.h | 9 +++++++-- test/IECore/LevenbergMarquardtTest.h | 9 +++++++-- test/IECore/LevenbergMarquardtTest.inl | 7 ++----- test/IECore/ParameterThreadingTest.cpp | 5 +++++ test/IECore/SpaceTransformTest.h | 8 +++++++- test/IECore/SweepAndPruneTest.h | 6 ++++++ test/IECore/TypedDataTest.h | 4 ++++ 11 files changed, 64 insertions(+), 13 deletions(-) diff --git a/test/IECore/CompilerTest.h b/test/IECore/CompilerTest.h index f9cc552beb..0a103f6709 100644 --- a/test/IECore/CompilerTest.h +++ b/test/IECore/CompilerTest.h @@ -39,11 +39,17 @@ #include "IECore/Export.h" IECORE_PUSH_DEFAULT_VISIBILITY +#include "OpenEXR/OpenEXRConfig.h" +#if OPENEXR_VERSION_MAJOR < 3 #include "OpenEXR/ImathBox.h" #include "OpenEXR/ImathVec.h" -IECORE_POP_DEFAULT_VISIBILITY - #include "OpenEXR/ImathLineAlgo.h" +#else +#include "Imath/ImathBox.h" +#include "Imath/ImathVec.h" +#include "Imath/ImathLineAlgo.h" +#endif +IECORE_POP_DEFAULT_VISIBILITY IECORE_PUSH_DEFAULT_VISIBILITY #include "boost/test/unit_test.hpp" diff --git a/test/IECore/IECoreTest.cpp b/test/IECore/IECoreTest.cpp index 6b2a16647c..9bbf2e2760 100644 --- a/test/IECore/IECoreTest.cpp +++ b/test/IECore/IECoreTest.cpp @@ -35,7 +35,12 @@ #include "IECore/Export.h" IECORE_PUSH_DEFAULT_VISIBILITY +#include "OpenEXR/OpenEXRConfig.h" +#if OPENEXR_VERSION_MAJOR < 3 #include "OpenEXR/ImathColor.h" +#else +#include "Imath/ImathColor.h" +#endif IECORE_POP_DEFAULT_VISIBILITY #include diff --git a/test/IECore/InternedStringTest.cpp b/test/IECore/InternedStringTest.cpp index c300f1df7d..98455f351e 100644 --- a/test/IECore/InternedStringTest.cpp +++ b/test/IECore/InternedStringTest.cpp @@ -36,7 +36,12 @@ #include "IECore/InternedString.h" +#include "OpenEXR/OpenEXRConfig.h" +#if OPENEXR_VERSION_MAJOR < 3 #include "OpenEXR/ImathRandom.h" +#else +#include "Imath/ImathRandom.h" +#endif #include "boost/lexical_cast.hpp" diff --git a/test/IECore/InterpolatorTest.h b/test/IECore/InterpolatorTest.h index e9b6c6d874..82d6390b0f 100644 --- a/test/IECore/InterpolatorTest.h +++ b/test/IECore/InterpolatorTest.h @@ -39,11 +39,18 @@ #include "IECore/Interpolator.h" IECORE_PUSH_DEFAULT_VISIBILITY +#include "OpenEXR/OpenEXRConfig.h" +#if OPENEXR_VERSION_MAJOR < 3 #include "OpenEXR/ImathMatrix.h" +#include "OpenEXR/ImathMatrixAlgo.h" #include "OpenEXR/ImathVec.h" +#else +#include "Imath/ImathMatrix.h" +#include "Imath/ImathMatrixAlgo.h" +#include "Imath/ImathVec.h" +#endif IECORE_POP_DEFAULT_VISIBILITY -#include "OpenEXR/ImathMatrixAlgo.h" IECORE_PUSH_DEFAULT_VISIBILITY #include "boost/test/unit_test.hpp" diff --git a/test/IECore/KDTreeTest.h b/test/IECore/KDTreeTest.h index b966e10eca..3dfa96cf15 100644 --- a/test/IECore/KDTreeTest.h +++ b/test/IECore/KDTreeTest.h @@ -39,10 +39,15 @@ #include "IECore/KDTree.h" IECORE_PUSH_DEFAULT_VISIBILITY +#include "OpenEXR/OpenEXRConfig.h" +#if OPENEXR_VERSION_MAJOR < 3 #include "OpenEXR/ImathVec.h" -IECORE_POP_DEFAULT_VISIBILITY - #include "OpenEXR/ImathRandom.h" +#else +#include "Imath/ImathVec.h" +#include "Imath/ImathRandom.h" +#endif +IECORE_POP_DEFAULT_VISIBILITY IECORE_PUSH_DEFAULT_VISIBILITY #include "boost/test/unit_test.hpp" diff --git a/test/IECore/LevenbergMarquardtTest.h b/test/IECore/LevenbergMarquardtTest.h index ba6592bf44..28f3aa671a 100644 --- a/test/IECore/LevenbergMarquardtTest.h +++ b/test/IECore/LevenbergMarquardtTest.h @@ -39,11 +39,16 @@ #include "IECore/LevenbergMarquardt.h" IECORE_PUSH_DEFAULT_VISIBILITY +#include "OpenEXR/OpenEXRConfig.h" +#if OPENEXR_VERSION_MAJOR < 3 +#include "OpenEXR/ImathRandom.h" #include "OpenEXR/ImathVec.h" +#else +#include "Imath/ImathRandom.h" +#include "Imath/ImathVec.h" +#endif IECORE_POP_DEFAULT_VISIBILITY -#include "OpenEXR/ImathRandom.h" - IECORE_PUSH_DEFAULT_VISIBILITY #include "boost/test/unit_test.hpp" IECORE_POP_DEFAULT_VISIBILITY diff --git a/test/IECore/LevenbergMarquardtTest.inl b/test/IECore/LevenbergMarquardtTest.inl index 63d9b30261..feaf2f1a0e 100644 --- a/test/IECore/LevenbergMarquardtTest.inl +++ b/test/IECore/LevenbergMarquardtTest.inl @@ -32,9 +32,6 @@ // ////////////////////////////////////////////////////////////////////////// -#include "OpenEXR/ImathMath.h" -#include "OpenEXR/ImathRandom.h" - #include "boost/math/tools/rational.hpp" using namespace IECore; @@ -62,7 +59,7 @@ class LevenbergMarquardtTestSimple::Fn for ( unsigned i = 1; i <= m_num; i ++ ) { /// Distance between our guess and the real function - errors->writable()[i-1] = Imath::Math::fabs( + errors->writable()[i-1] = std::abs( parameters->readable()[i-1] - i * i ); @@ -149,7 +146,7 @@ class LevenbergMarquardtTestPolynomialFit::Fn T v2 = boost::math::tools::evaluate_polynomial( m_coeffs, (T(i) / m_num - 0.5) * 10.0); /// Distance between our guess and the real function - errors->writable()[i] = Imath::Math::fabs( v1 - v2 ); + errors->writable()[i] = std::abs( v1 - v2 ); } } diff --git a/test/IECore/ParameterThreadingTest.cpp b/test/IECore/ParameterThreadingTest.cpp index b66b1e9251..2a8d997438 100644 --- a/test/IECore/ParameterThreadingTest.cpp +++ b/test/IECore/ParameterThreadingTest.cpp @@ -42,7 +42,12 @@ #include "IECore/TypedObjectParameter.h" #include "IECore/VectorTypedParameter.h" +#include "OpenEXR/OpenEXRConfig.h" +#if OPENEXR_VERSION_MAJOR < 3 #include "OpenEXR/ImathRandom.h" +#else +#include "Imath/ImathRandom.h" +#endif #include "tbb/parallel_for.h" diff --git a/test/IECore/SpaceTransformTest.h b/test/IECore/SpaceTransformTest.h index 4ff5a1e9d1..8ef1fc7a28 100644 --- a/test/IECore/SpaceTransformTest.h +++ b/test/IECore/SpaceTransformTest.h @@ -40,10 +40,16 @@ #include "IECore/SphericalToEuclideanTransform.h" IECORE_PUSH_DEFAULT_VISIBILITY +#include "OpenEXR/OpenEXRConfig.h" +#if OPENEXR_VERSION_MAJOR < 3 #include "OpenEXR/ImathVec.h" +#include "OpenEXR/ImathRandom.h" +#else +#include "Imath/ImathVec.h" +#include "Imath/ImathRandom.h" +#endif IECORE_POP_DEFAULT_VISIBILITY -#include "OpenEXR/ImathRandom.h" IECORE_PUSH_DEFAULT_VISIBILITY #include "boost/test/unit_test.hpp" diff --git a/test/IECore/SweepAndPruneTest.h b/test/IECore/SweepAndPruneTest.h index e05c9cc3d7..9cb2e17398 100644 --- a/test/IECore/SweepAndPruneTest.h +++ b/test/IECore/SweepAndPruneTest.h @@ -43,8 +43,14 @@ #include "IECore/VectorTraits.h" IECORE_PUSH_DEFAULT_VISIBILITY +#include "OpenEXR/OpenEXRConfig.h" +#if OPENEXR_VERSION_MAJOR < 3 #include "OpenEXR/ImathBox.h" #include "OpenEXR/ImathVec.h" +#else +#include "Imath/ImathBox.h" +#include "Imath/ImathVec.h" +#endif IECORE_POP_DEFAULT_VISIBILITY IECORE_PUSH_DEFAULT_VISIBILITY diff --git a/test/IECore/TypedDataTest.h b/test/IECore/TypedDataTest.h index 4412f2264c..04b6f681b0 100644 --- a/test/IECore/TypedDataTest.h +++ b/test/IECore/TypedDataTest.h @@ -39,7 +39,11 @@ #include "IECore/SimpleTypedData.h" #include "IECore/VectorTypedData.h" +#if OPENEXR_VERSION_MAJOR < 3 #include "OpenEXR/ImathRandom.h" +#else +#include "Imath/ImathRandom.h" +#endif IECORE_PUSH_DEFAULT_VISIBILITY #include "boost/test/unit_test.hpp" From dd1fa7496c20b8843c5aeab802ca59537192573e Mon Sep 17 00:00:00 2001 From: John Haddon Date: Fri, 21 Jul 2023 16:03:08 +0100 Subject: [PATCH 4/5] CI : Update to GafferHQ/dependencies 7.0.0 This means that the packages uploaded for each Cortex release will be suitable for building Gaffer 1.3 with. --- .github/workflows/main.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index bef61e91d5..8de8539a4c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -43,7 +43,7 @@ jobs: buildType: RELEASE containerImage: ghcr.io/gafferhq/build/build:2.0.0 options: .github/workflows/main/options.posix - dependenciesURL: https://github.com/GafferHQ/dependencies/releases/download/6.0.0/gafferDependencies-6.0.0-linux.tar.gz + dependenciesURL: https://github.com/GafferHQ/dependencies/releases/download/7.0.0/gafferDependencies-7.0.0-linux.tar.gz tests: testCore testCorePython testScene testImage testAlembic testUSD testVDB publish: true @@ -52,7 +52,7 @@ jobs: buildType: DEBUG containerImage: ghcr.io/gafferhq/build/build:2.0.0 options: .github/workflows/main/options.posix - dependenciesURL: https://github.com/GafferHQ/dependencies/releases/download/6.0.0/gafferDependencies-6.0.0-linux.tar.gz + dependenciesURL: https://github.com/GafferHQ/dependencies/releases/download/7.0.0/gafferDependencies-7.0.0-linux.tar.gz tests: testCore testCorePython testScene testImage testAlembic testUSD testVDB publish: false @@ -60,7 +60,7 @@ jobs: os: windows-2019 buildType: RELEASE options: .github/workflows/main/options.windows - dependenciesURL: https://github.com/GafferHQ/dependencies/releases/download/6.0.0/gafferDependencies-6.0.0-windows.zip + dependenciesURL: https://github.com/GafferHQ/dependencies/releases/download/7.0.0/gafferDependencies-7.0.0-windows.zip tests: testCore testCorePython testScene testImage testAlembic testUSD testVDB publish: true @@ -68,7 +68,7 @@ jobs: os: windows-2019 buildType: RELWITHDEBINFO options: .github/workflows/main/options.windows - dependenciesURL: https://github.com/GafferHQ/dependencies/releases/download/6.0.0/gafferDependencies-6.0.0-windows.zip + dependenciesURL: https://github.com/GafferHQ/dependencies/releases/download/7.0.0/gafferDependencies-7.0.0-windows.zip tests: testCore testCorePython testScene testImage testAlembic testUSD testVDB publish: false From 9ec93a63baf2b07209fb74a813050982c4e01039 Mon Sep 17 00:00:00 2001 From: John Haddon Date: Mon, 24 Jul 2023 13:58:35 +0100 Subject: [PATCH 5/5] Imath test : Relax assertion Imath 2 raised RuntimeError here, and Imath 3 raises ValueError instead. These tests date back to when we had our own bindings for Imath, because official bindings didn't exist - it's not even clear that we need them any more. --- test/IECore/Imath.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/IECore/Imath.py b/test/IECore/Imath.py index d783c113c7..f922b700d0 100644 --- a/test/IECore/Imath.py +++ b/test/IECore/Imath.py @@ -81,8 +81,8 @@ def testConstructors(self): self.assertEqual(v.x, 1) self.assertEqual(v.y, 1) - self.assertRaises( RuntimeError, imath.V2f, [ 1 ] ) - self.assertRaises( RuntimeError, imath.V2f, [ 1, 2, 3 ] ) + self.assertRaises( Exception, imath.V2f, [ 1 ] ) + self.assertRaises( Exception, imath.V2f, [ 1, 2, 3 ] ) def testDimensions(self): """Test V2f dimensions""" @@ -291,9 +291,9 @@ def testConstructors(self): self.assertEqual(v.y, 1) self.assertEqual(v.z, 1) - self.assertRaises( RuntimeError, imath.V3f, [ 1 ] ) - self.assertRaises( RuntimeError, imath.V3f, [ 1, 2 ] ) - self.assertRaises( RuntimeError, imath.V3f, [ 1, 2, 3, 4 ] ) + self.assertRaises( Exception, imath.V3f, [ 1 ] ) + self.assertRaises( Exception, imath.V3f, [ 1, 2 ] ) + self.assertRaises( Exception, imath.V3f, [ 1, 2, 3, 4 ] ) def testDimensions(self): """Test V3f dimensions"""