AnalogTapeModel

Physical modelling signal processing for analog tape recording
Log | Files | Refs | Submodules | README | LICENSE

commit 74f606a0d1eaf443356ed781afc0858ca419a543
parent c28483332c003350cbade8012954d79af3ec5391
Author: jatinchowdhury18 <[email protected]>
Date:   Mon, 12 Apr 2021 15:22:28 -0700

Fix unit tests runner (#181)


Diffstat:
M.github/workflows/cmake.yml | 2+-
MPlugin/Source/Headless/UnitTests/UnitTests.cpp | 17+++++++++--------
MPlugin/Source/Headless/UnitTests/UnitTests.h | 2+-
MPlugin/modules/WarningFlags.cmake | 2++
4 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml @@ -53,7 +53,7 @@ jobs: working-directory: ${{github.workspace}}/Plugin run: cmake -Bbuild - - name: Configure + - name: Configure (Headless) shell: bash if: runner.os == 'Linux' working-directory: ${{github.workspace}}/Plugin diff --git a/Plugin/Source/Headless/UnitTests/UnitTests.cpp b/Plugin/Source/Headless/UnitTests/UnitTests.cpp @@ -40,9 +40,7 @@ void UnitTests::runUnitTests (const ArgumentList& args) ConsoleUnitTestRunner runner; auto seed = getRandomSeed (args); - auto tests = UnitTest::getAllTests(); - getTestsForArgs (tests, args); - + auto tests = getTestsForArgs (args); runner.runTests (tests, seed); Logger::setCurrentLogger (nullptr); @@ -66,14 +64,17 @@ int64 UnitTests::getRandomSeed (const ArgumentList& args) return int64 (0); } -void UnitTests::getTestsForArgs (Array<UnitTest*>& tests, const ArgumentList& args) +Array<UnitTest*> UnitTests::getTestsForArgs (const ArgumentList& args) { if (args.containsOption ("--all")) - return; + return UnitTest::getAllTests(); - for (auto* t : tests) + Array<UnitTest*> unitTests; + for (auto* test : UnitTest::getAllTests()) { - if (! args.containsOption (t->getName())) - tests.remove (&t); + if (args.containsOption (test->getName())) + unitTests.add (test); } + + return unitTests; } diff --git a/Plugin/Source/Headless/UnitTests/UnitTests.h b/Plugin/Source/Headless/UnitTests/UnitTests.h @@ -9,7 +9,7 @@ public: private: int64 getRandomSeed (const ArgumentList& args); - void getTestsForArgs (Array<UnitTest*>& tests, const ArgumentList& args); + Array<UnitTest*> getTestsForArgs (const ArgumentList& args); JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (UnitTests) }; diff --git a/Plugin/modules/WarningFlags.cmake b/Plugin/modules/WarningFlags.cmake @@ -22,6 +22,7 @@ elseif((CMAKE_CXX_COMPILER_ID STREQUAL "Clang") OR (CMAKE_CXX_COMPILER_ID STREQU # Comment them out to be more strict. -Wno-shadow-field-in-constructor -Wno-shadow-field -Wno-sign-conversion -Wno-float-conversion -Wno-implicit-float-conversion -Wno-switch-enum + -Wno-macro-redefined # For XSIMD -Wno-cast-align -Wno-shadow -Wno-implicit-int-conversion -Wno-zero-as-null-pointer-constant @@ -36,6 +37,7 @@ elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") # These lines suppress some warnings from Foley's GUI Magic and RTNeural. # Comment them out to be more strict. -Wno-sign-conversion -Wno-switch-enum -Wno-overloaded-virtual + -Wno-macro-redefined # For XSIMD -Wno-zero-as-null-pointer-constant # From LV2 Wrapper