How to test shared_module
?
#11208
-
I have a project that builds a shared module: my_shared_module = shared_module(...) I would like to test it via running an executable that supports loading modules FILE *fopt = popen("opt -load-pass-plugin=path/to/my_shared_module.so moreargs path/to/file.ll", "r") and then compare the results with some expected results: FILE *ftxt = fopen("path/to/cmpfile.txt", "r") However, I have two problems here:
Or, is there a better approach? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Perhaps I can solve the path via defining a macro to be |
Beta Was this translation helpful? Give feedback.
-
test('name', exe, ..., depends: [my_shared_module])
How are you running it? If you pass a built target as part of the There's also |
Beta Was this translation helpful? Give feedback.
How are you running it? If you pass a built target as part of the
args:
kwarg, Meson will guarantee the path resolves correctly to the built object.There's also
my_shared_module.full_path()
to yield a string. This may be necessary if it must be--flag=path/to/module
instead of--flag path/to/module
. But in that case you needdepends:
as meson cannot figure out dependencies automatically from a string.