Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running clap-validator in Examples CI #557

Merged
merged 3 commits into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .github/workflows/examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
workflow_dispatch:

env:
EXAMPLE_TARGETS: "ForwardingTestPlugin_Standalone ModalSpringReverb_Standalone SimpleEQ_Standalone StatefulPlugin_Standalone ExampleCompressor_Standalone"
EXAMPLE_TARGETS: "ForwardingTestPlugin_CLAP ModalSpringReverb_CLAP SimpleEQ_CLAP StatefulPlugin_CLAP ExampleCompressor_CLAP"

jobs:
build_examples:
Expand Down Expand Up @@ -48,3 +48,9 @@ jobs:
- name: "Build Example: ${{ matrix.target }}"
shell: bash
run: cmake --build build --parallel 4 --target $EXAMPLE_TARGETS

- name: run clap-validator
uses: jatinchowdhury18/clap-val-action@main
with:
plugin_path: build/plugin_products/SimpleEQ.clap build/plugin_products/StatefulPlugin.clap build/plugin_products/ExampleCompressor.clap
args: --only-failed --hide-output --invert-filter --test-filter "state-*"
13 changes: 13 additions & 0 deletions cmake/test/SetupExamplePlugin.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,17 @@ function(setup_example_plugin target code)
CLAP_PROCESS_EVENTS_RESOLUTION_SAMPLES 64
CLAP_USE_JUCE_PARAMETER_RANGES DISCRETE
)

get_target_property(output_dir ${target} RUNTIME_OUTPUT_DIRECTORY)
foreach(format AU Standalone VST3 CLAP)
if(TARGET ${target}_${format})
add_custom_command(
TARGET ${target}_${format}
POST_BUILD
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMAND echo "${target}: Relocating ${format} component"
COMMAND ${CMAKE_COMMAND} -E copy_directory ${output_dir}/${format} ${CMAKE_BINARY_DIR}/plugin_products/
)
endif()
endforeach()
endfunction(setup_example_plugin)
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ struct PeakRtTDetector
T* z,
T thresholdGain) noexcept
{
jassert (inBuffer.getNumChannels() == outBuffer.getNumSamples());
jassert (inBuffer.getNumChannels() == outBuffer.getNumChannels());
jassert (inBuffer.getNumSamples() == outBuffer.getNumSamples());

for (auto [ch, inData, outData] : buffer_iters::zip_channels (inBuffer, outBuffer))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,16 @@
return timeSecStr + " s";
}

float stringToTimeMsVal (const juce::String& s) { return s.getFloatValue(); }
float stringToTimeMsVal (const juce::String& s)

Check warning on line 56 in modules/plugin/chowdsp_parameters/ParamUtils/chowdsp_ParameterConversions.cpp

View check run for this annotation

Codecov / codecov/patch

modules/plugin/chowdsp_parameters/ParamUtils/chowdsp_ParameterConversions.cpp#L56

Added line #L56 was not covered by tests
{
auto timeVal = s.getFloatValue();

Check warning on line 58 in modules/plugin/chowdsp_parameters/ParamUtils/chowdsp_ParameterConversions.cpp

View check run for this annotation

Codecov / codecov/patch

modules/plugin/chowdsp_parameters/ParamUtils/chowdsp_ParameterConversions.cpp#L58

Added line #L58 was not covered by tests

if (s.endsWith (" s") || s.endsWith (" S")
|| s.endsWith (" seconds") || s.endsWith (" Seconds"))
timeVal *= 1000.0f;

Check warning on line 62 in modules/plugin/chowdsp_parameters/ParamUtils/chowdsp_ParameterConversions.cpp

View check run for this annotation

Codecov / codecov/patch

modules/plugin/chowdsp_parameters/ParamUtils/chowdsp_ParameterConversions.cpp#L61-L62

Added lines #L61 - L62 were not covered by tests

return timeVal;

Check warning on line 64 in modules/plugin/chowdsp_parameters/ParamUtils/chowdsp_ParameterConversions.cpp

View check run for this annotation

Codecov / codecov/patch

modules/plugin/chowdsp_parameters/ParamUtils/chowdsp_ParameterConversions.cpp#L64

Added line #L64 was not covered by tests
}

juce::String semitonesValToString (float semitonesVal, bool snapToInt)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ TEST_CASE ("Param Strings Test", "[plugin][parameters]")
REQUIRE_MESSAGE (timeMsValToString (10.0f) == juce::String ("10.00 ms"), "Incorrect milliseconds string!");
REQUIRE_MESSAGE (timeMsValToString (2000.0f) == juce::String ("2.00 s"), "Incorrect seconds string!");
REQUIRE_MESSAGE (juce::approximatelyEqual (stringToTimeMsVal ("200 ms"), 200.0f), "Incorrect milliseconds value!");
REQUIRE_MESSAGE (juce::approximatelyEqual (stringToTimeMsVal ("2.00 s"), 2'000.0f), "Incorrect seconds value!");
}

SECTION ("Semitones Param Test")
Expand Down
Loading