File tree Expand file tree Collapse file tree 2 files changed +43
-0
lines changed Expand file tree Collapse file tree 2 files changed +43
-0
lines changed Original file line number Diff line number Diff line change @@ -51,6 +51,7 @@ if (${CLAP_HELPERS_BUILD_TESTS})
51
51
endif ()
52
52
53
53
add_executable (${PROJECT_NAME} -tests EXCLUDE_FROM_ALL
54
+ tests/create-an-actual-plugin.cc
54
55
tests/hex-encoder.cc
55
56
tests/plugin.cc
56
57
tests/param-queue-tests.cc
Original file line number Diff line number Diff line change
1
+ /*
2
+ * Actually use plugin.hh / plugin.hxx to create a plugin. Assert that it is constructable
3
+ */
4
+
5
+ #include " clap/helpers/plugin.hh"
6
+ #include " clap/helpers/plugin.hxx"
7
+
8
+ #include < type_traits>
9
+
10
+ #include < catch2/catch_all.hpp>
11
+
12
+ struct test_plugin : clap::helpers::Plugin<clap::helpers::MisbehaviourHandler::Terminate,
13
+ clap::helpers::CheckingLevel::Maximal>
14
+ {
15
+ const clap_plugin_descriptor *getDescription ()
16
+ {
17
+ static const char *features[] = {CLAP_PLUGIN_FEATURE_INSTRUMENT,
18
+ CLAP_PLUGIN_FEATURE_SYNTHESIZER, nullptr };
19
+ static clap_plugin_descriptor desc = {CLAP_VERSION,
20
+ " org.free-audio.test-case.plugin" ,
21
+ " Test Case Plugin" ,
22
+ " Free Audio" ,
23
+ " http://cleveraudio.org" ,
24
+ " " ,
25
+ " " ,
26
+ " 1.0.0" ,
27
+ " This is a test only plugin" ,
28
+ &features[0 ]};
29
+ return &desc;
30
+ }
31
+
32
+ test_plugin (const clap_host *host) : clap::helpers::Plugin<clap::helpers::MisbehaviourHandler::Terminate,
33
+ clap::helpers::CheckingLevel::Maximal>(getDescription(), host) {}
34
+ };
35
+
36
+ CATCH_TEST_CASE (" Create an Actual Plugin" )
37
+ {
38
+ CATCH_SECTION (" Test Plugin is Creatable" )
39
+ {
40
+ CATCH_REQUIRE (std::is_constructible<test_plugin, const clap_host *>::value);
41
+ }
42
+ }
You can’t perform that action at this time.
0 commit comments