Skip to content

Commit

Permalink
Context Menu Builder still referred to draft/ location
Browse files Browse the repository at this point in the history
The context menu still refered to context-menu include with
 a draft and our test suite didn't exercise it, so the code
doens't build against 1.2.0

Fix both the include and add a test
  • Loading branch information
baconpaul committed Jan 22, 2024
1 parent 0a5d34d commit 278ad9d
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1 deletion.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ if (${CLAP_HELPERS_BUILD_TESTS})
endif()

add_executable(${PROJECT_NAME}-tests EXCLUDE_FROM_ALL
tests/context-menu-builder-compiles.cc
tests/create-an-actual-host.cc
tests/create-an-actual-plugin.cc
tests/hex-encoder.cc
Expand Down
2 changes: 1 addition & 1 deletion include/clap/helpers/context-menu-builder.hh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include <clap/ext/draft/context-menu.h>
#include <clap/ext/context-menu.h>

namespace clap { namespace helpers {

Expand Down
24 changes: 24 additions & 0 deletions tests/context-menu-builder-compiles.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#include <clap/helpers/context-menu-builder.hh>

#include <type_traits>
#include <catch2/catch_all.hpp>

namespace {

struct TestBuilder : clap::helpers::ContextMenuBuilder {
TestBuilder() {}
bool addItem(clap_context_menu_item_kind_t item_kind, const void *item_data) override
{
return false;
}
bool supports(clap_context_menu_item_kind_t item_kind) const noexcept override
{
return false;
}
};

CATCH_TEST_CASE("Context Menu Builder exists") {
CATCH_REQUIRE(std::is_constructible<TestBuilder>::value);
}

} // namespace

0 comments on commit 278ad9d

Please sign in to comment.