diff options
-rw-r--r-- | test/lilv_test.c | 40 | ||||
-rw-r--r-- | test/manifest.ttl.in (renamed from test/manifest.ttl) | 2 | ||||
-rw-r--r-- | test/test_plugin.ttl.in (renamed from test/test_plugin.ttl) | 0 | ||||
-rw-r--r-- | wscript | 11 |
4 files changed, 32 insertions, 21 deletions
diff --git a/test/lilv_test.c b/test/lilv_test.c index 0a8a226..44596f0 100644 --- a/test/lilv_test.c +++ b/test/lilv_test.c @@ -34,6 +34,14 @@ #define TEST_PATH_MAX 1024 +#if defined(__APPLE__) +# define SHLIB_EXT ".dylib" +#elif defined(__WIN32__) +# define SHLIB_EXT ".dll" +#else +# define SHLIB_EXT ".so" +#endif + static char bundle_dir_name[TEST_PATH_MAX]; static char bundle_dir_uri[TEST_PATH_MAX]; static char manifest_name[TEST_PATH_MAX]; @@ -205,7 +213,7 @@ int test_value(void) { if (!start_bundle(MANIFEST_PREFIXES - ":plug a lv2:Plugin ; lv2:binary <foo.so> ; rdfs:seeAlso <plugin.ttl> .\n", + ":plug a lv2:Plugin ; lv2:binary <foo" SHLIB_EXT "> ; rdfs:seeAlso <plugin.ttl> .\n", BUNDLE_PREFIXES ":plug a lv2:Plugin ; a lv2:CompressorPlugin ; " PLUGIN_NAME("Test plugin") " ; " @@ -324,7 +332,7 @@ discovery_verify_plugin(const LilvPlugin* plugin) TEST_ASSERT(lib_uri); TEST_ASSERT(lilv_node_is_uri(lib_uri)); TEST_ASSERT(lilv_node_as_uri(lib_uri)); - TEST_ASSERT(strstr(lilv_node_as_uri(lib_uri), "foo.so")); + TEST_ASSERT(strstr(lilv_node_as_uri(lib_uri), "foo" SHLIB_EXT)); TEST_ASSERT(lilv_plugin_verify(plugin)); } } @@ -333,7 +341,7 @@ int test_discovery(void) { if (!start_bundle(MANIFEST_PREFIXES - ":plug a lv2:Plugin ; lv2:binary <foo.so> ; rdfs:seeAlso <plugin.ttl> .\n", + ":plug a lv2:Plugin ; lv2:binary <foo" SHLIB_EXT "> ; rdfs:seeAlso <plugin.ttl> .\n", BUNDLE_PREFIXES ":plug a lv2:Plugin ;" PLUGIN_NAME("Test plugin") " ; " @@ -376,7 +384,7 @@ int test_verify(void) { if (!start_bundle(MANIFEST_PREFIXES - ":plug a lv2:Plugin ; lv2:binary <foo.so> ; rdfs:seeAlso <plugin.ttl> .\n", + ":plug a lv2:Plugin ; lv2:binary <foo" SHLIB_EXT "> ; rdfs:seeAlso <plugin.ttl> .\n", BUNDLE_PREFIXES ":plug a lv2:Plugin ; " PLUGIN_NAME("Test plugin") " ; " @@ -400,7 +408,7 @@ int test_no_verify(void) { if (!start_bundle(MANIFEST_PREFIXES - ":plug a lv2:Plugin ; lv2:binary <foo.so> ; rdfs:seeAlso <plugin.ttl> .\n", + ":plug a lv2:Plugin ; lv2:binary <foo" SHLIB_EXT "> ; rdfs:seeAlso <plugin.ttl> .\n", BUNDLE_PREFIXES ":plug a lv2:Plugin . ")) return 0; @@ -420,7 +428,7 @@ int test_classes(void) { if (!start_bundle(MANIFEST_PREFIXES - ":plug a lv2:Plugin ; lv2:binary <foo.so> ; rdfs:seeAlso <plugin.ttl> .\n", + ":plug a lv2:Plugin ; lv2:binary <foo" SHLIB_EXT "> ; rdfs:seeAlso <plugin.ttl> .\n", BUNDLE_PREFIXES ":plug a lv2:Plugin ; a lv2:CompressorPlugin ; " PLUGIN_NAME("Test plugin") " ; " @@ -464,7 +472,7 @@ int test_plugin(void) { if (!start_bundle(MANIFEST_PREFIXES - ":plug a lv2:Plugin ; lv2:binary <foo.so> ; rdfs:seeAlso <plugin.ttl> .\n", + ":plug a lv2:Plugin ; lv2:binary <foo" SHLIB_EXT "> ; rdfs:seeAlso <plugin.ttl> .\n", BUNDLE_PREFIXES ":plug a lv2:Plugin ; a lv2:CompressorPlugin ; " PLUGIN_NAME("Test plugin") " ; " @@ -669,7 +677,7 @@ int test_port(void) { if (!start_bundle(MANIFEST_PREFIXES - ":plug a lv2:Plugin ; lv2:binary <foo.so> ; rdfs:seeAlso <plugin.ttl> .\n", + ":plug a lv2:Plugin ; lv2:binary <foo" SHLIB_EXT "> ; rdfs:seeAlso <plugin.ttl> .\n", BUNDLE_PREFIXES PREFIX_LV2EV ":plug a lv2:Plugin ; " PLUGIN_NAME("Test plugin") " ; " @@ -904,7 +912,7 @@ int test_ui(void) { if (!start_bundle(MANIFEST_PREFIXES - ":plug a lv2:Plugin ; lv2:binary <foo.so> ; rdfs:seeAlso <plugin.ttl> .\n", + ":plug a lv2:Plugin ; lv2:binary <foo" SHLIB_EXT "> ; rdfs:seeAlso <plugin.ttl> .\n", BUNDLE_PREFIXES PREFIX_LV2UI ":plug a lv2:Plugin ; a lv2:CompressorPlugin ; " PLUGIN_NAME("Test plugin") " ; " @@ -929,11 +937,11 @@ test_ui(void) "] .\n" ":ui a lv2ui:GtkUI ; " " lv2ui:requiredFeature lv2ui:makeResident ; " - " lv2ui:binary <ui.so> ; " + " lv2ui:binary <ui" SHLIB_EXT "> ; " " lv2ui:optionalFeature lv2ui:ext_presets . " - ":ui2 a lv2ui:GtkUI ; lv2ui:binary <ui2.so> . " - ":ui3 a lv2ui:GtkUI ; lv2ui:binary <ui3.so> . " - ":ui4 a lv2ui:GtkUI ; lv2ui:binary <ui4.so> . ")) + ":ui2 a lv2ui:GtkUI ; lv2ui:binary <ui2" SHLIB_EXT "> . " + ":ui3 a lv2ui:GtkUI ; lv2ui:binary <ui3" SHLIB_EXT "> . " + ":ui4 a lv2ui:GtkUI ; lv2ui:binary <ui4" SHLIB_EXT "> . ")) return 0; init_uris(); @@ -984,7 +992,7 @@ test_ui(void) char* ui_binary_uri_str = (char*)malloc(TEST_PATH_MAX); snprintf(ui_binary_uri_str, TEST_PATH_MAX, "%s%s", - lilv_node_as_string(plug_bundle_uri), "ui.so"); + lilv_node_as_string(plug_bundle_uri), "ui" SHLIB_EXT); const LilvNode* ui_binary_uri = lilv_ui_get_binary_uri(ui0); @@ -1196,7 +1204,7 @@ int test_bad_port_symbol(void) { if (!start_bundle(MANIFEST_PREFIXES - ":plug a lv2:Plugin ; lv2:binary <foo.so> ; rdfs:seeAlso <plugin.ttl> .\n", + ":plug a lv2:Plugin ; lv2:binary <foo" SHLIB_EXT "> ; rdfs:seeAlso <plugin.ttl> .\n", BUNDLE_PREFIXES PREFIX_LV2EV ":plug a lv2:Plugin ; " PLUGIN_NAME("Test plugin") " ; " @@ -1227,7 +1235,7 @@ int test_bad_port_index(void) { if (!start_bundle(MANIFEST_PREFIXES - ":plug a lv2:Plugin ; lv2:binary <foo.so> ; rdfs:seeAlso <plugin.ttl> .\n", + ":plug a lv2:Plugin ; lv2:binary <foo" SHLIB_EXT "> ; rdfs:seeAlso <plugin.ttl> .\n", BUNDLE_PREFIXES PREFIX_LV2EV ":plug a lv2:Plugin ; " PLUGIN_NAME("Test plugin") " ; " diff --git a/test/manifest.ttl b/test/manifest.ttl.in index 5af7e88..48b009b 100644 --- a/test/manifest.ttl +++ b/test/manifest.ttl.in @@ -3,5 +3,5 @@ <http://example.org/lilv-test-plugin> a lv2:Plugin ; - lv2:binary <test_plugin.so> ; + lv2:binary <test_plugin@SHLIB_EXT@> ; rdfs:seeAlso <test_plugin.ttl> . diff --git a/test/test_plugin.ttl b/test/test_plugin.ttl.in index ec16d00..ec16d00 100644 --- a/test/test_plugin.ttl +++ b/test/test_plugin.ttl.in @@ -243,6 +243,8 @@ def build(bld): if shlib_pattern.startswith('lib'): shlib_pattern = shlib_pattern[3:] penv['cshlib_PATTERN'] = shlib_pattern + shlib_ext = shlib_pattern[shlib_pattern.rfind('.'):] + obj = bld(features = 'c cshlib', env = penv, source = 'test/test_plugin.c', @@ -252,11 +254,12 @@ def build(bld): uselib = 'LV2CORE LV2_STATE LV2_URID') # Test plugin data files - for i in [ 'manifest.ttl', 'test_plugin.ttl' ]: - bld(rule = 'cp ${SRC} ${TGT}', + for i in [ 'manifest.ttl.in', 'test_plugin.ttl.in' ]: + bld(features = 'subst', source = 'test/' + i, - target = 'test/test_plugin.lv2/' + i, - install_path = None) + target = 'test/test_plugin.lv2/' + i.replace('.in', ''), + install_path = None, + SHLIB_EXT = shlib_ext) # Static profiled library (for unit test code coverage) obj = bld(features = 'c cstlib', |