From c47f20c7b05cd8777933e87b83c189fef05fbb7a Mon Sep 17 00:00:00 2001 From: Marcus Tomlinson Date: Wed, 20 Nov 2024 10:10:22 +0000 Subject: [PATCH] Warn instead of fail in performance tests --- tests/main.cpp | 38 ++++++++++++++++++++++++++++---------- 1 file changed, 28 insertions(+), 10 deletions(-) diff --git a/tests/main.cpp b/tests/main.cpp index ba69aea2..97888337 100644 --- a/tests/main.cpp +++ b/tests/main.cpp @@ -457,10 +457,13 @@ TEST_CASE( "BufferPerformanceTest" ) overhead = 100 - ( 100 * ( eff / refEff ) ); std::cout << "2x Buffer Efficiency: " << eff << "% (-" << overhead << "%)" << std::endl; - REQUIRE( eff >= refEff * 0.5 * 0.80 ); + if ( eff < refEff * 0.5 * 0.80 ) + { + WARN( std::to_string( eff ) + " < " + std::to_string( refEff * 0.5 * 0.80 ) ); + } // Tick the circuit with 3 threads, and check that more ticks occurred - if ( std::thread::hardware_concurrency() < 6 ) + if ( std::thread::hardware_concurrency() < 3 ) { return; } @@ -476,10 +479,13 @@ TEST_CASE( "BufferPerformanceTest" ) overhead = 100 - ( 100 * ( eff / refEff ) ); std::cout << "3x Buffer Efficiency: " << eff << "% (-" << overhead << "%)" << std::endl; - REQUIRE( eff >= refEff * 0.75 * 0.80 ); + if ( eff < refEff * 0.75 * 0.80 ) + { + WARN( std::to_string( eff ) + " < " + std::to_string( refEff * 0.75 * 0.80 ) ); + } // Tick the circuit with 4 threads, and check that more ticks occurred - if ( std::thread::hardware_concurrency() < 8 ) + if ( std::thread::hardware_concurrency() < 4 ) { return; } @@ -495,7 +501,10 @@ TEST_CASE( "BufferPerformanceTest" ) overhead = 100 - ( 100 * ( eff / refEff ) ); std::cout << "4x Buffer Efficiency: " << eff << "% (-" << overhead << "%)" << std::endl; - REQUIRE( eff >= refEff * 0.80 ); + if ( eff < refEff * 0.80 ) + { + WARN( std::to_string( eff ) + " < " + std::to_string( refEff * 0.80 ) ); + } } TEST_CASE( "ThreadPerformanceTest" ) @@ -569,10 +578,13 @@ TEST_CASE( "ThreadPerformanceTest" ) overhead = 100 - ( 100 * ( eff / refEff ) ); std::cout << "2x Thread Efficiency: " << eff << "% (-" << overhead << "%)" << std::endl; - REQUIRE( eff >= refEff * 0.5 * 0.80 ); + if ( eff < refEff * 0.5 * 0.80 ) + { + WARN( std::to_string( eff ) + " < " + std::to_string( refEff * 0.5 * 0.80 ) ); + } // Tick the circuit with 3 threads, and check that more ticks occurred - if ( std::thread::hardware_concurrency() < 6 ) + if ( std::thread::hardware_concurrency() < 3 ) { return; } @@ -588,10 +600,13 @@ TEST_CASE( "ThreadPerformanceTest" ) overhead = 100 - ( 100 * ( eff / refEff ) ); std::cout << "3x Thread Efficiency: " << eff << "% (-" << overhead << "%)" << std::endl; - REQUIRE( eff >= refEff * 0.5 * 0.80 ); + if ( eff < refEff * 0.5 * 0.80 ) + { + WARN( std::to_string( eff ) + " < " + std::to_string( refEff * 0.5 * 0.80 ) ); + } // Tick the circuit with 4 threads, and check that more ticks occurred - if ( std::thread::hardware_concurrency() < 8 ) + if ( std::thread::hardware_concurrency() < 4 ) { return; } @@ -607,7 +622,10 @@ TEST_CASE( "ThreadPerformanceTest" ) overhead = 100 - ( 100 * ( eff / refEff ) ); std::cout << "4x Thread Efficiency: " << eff << "% (-" << overhead << "%)" << std::endl; - REQUIRE( eff >= refEff * 0.80 ); + if ( eff < refEff * 0.80 ) + { + WARN( std::to_string( eff ) + " < " + std::to_string( refEff * 0.80 ) ); + } } TEST_CASE( "StopAutoTickRegressionTest" )