diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2017-03-04 19:56:12 +0530 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2017-03-05 05:48:33 -0500 |
commit | 0543a378cafe71c26a60f1c136cff21005f98934 (patch) | |
tree | 84dd2038edf31982693571f44943f8ec932305f4 | |
parent | 16c27bef0b260e31f75bd39e8378644b7bd69916 (diff) | |
download | meson-0543a378cafe71c26a60f1c136cff21005f98934.zip meson-0543a378cafe71c26a60f1c136cff21005f98934.tar.gz meson-0543a378cafe71c26a60f1c136cff21005f98934.tar.bz2 |
tests: Minor fixes to the library-usage tests
Actually use the myFunc() symbol from the library, and actually run the
built executable on macOS.
6 files changed, 30 insertions, 11 deletions
diff --git a/test cases/linuxlike/7 library versions/exe.orig.c b/test cases/linuxlike/7 library versions/exe.orig.c index 1599ebd..86c4adc 100644 --- a/test cases/linuxlike/7 library versions/exe.orig.c +++ b/test cases/linuxlike/7 library versions/exe.orig.c @@ -1,5 +1,9 @@ +int myFunc (void); + int main (int argc, char *argv[]) { - return 0; + if (myFunc() == 55) + return 0; + return 1; } diff --git a/test cases/linuxlike/7 library versions/meson.build b/test cases/linuxlike/7 library versions/meson.build index c02bbed..48b75ad 100644 --- a/test cases/linuxlike/7 library versions/meson.build +++ b/test cases/linuxlike/7 library versions/meson.build @@ -26,6 +26,8 @@ out = custom_target('library-dependency-hack', depends : [some, noversion, onlyversion, onlysoversion], command : ['cp', '@INPUT@', '@OUTPUT@']) +# Need to add this manually because Meson can't add it automatically because +# it doesn't know that we are linking to libraries in the build directory. rpath_arg = '-Wl,-rpath,' + meson.current_build_dir() # Manually test if the linker can find the above libraries diff --git a/test cases/osx/2 library versions/exe.orig.c b/test cases/osx/2 library versions/exe.orig.c index 1a8cc62..86c4adc 100644 --- a/test cases/osx/2 library versions/exe.orig.c +++ b/test cases/osx/2 library versions/exe.orig.c @@ -1,4 +1,9 @@ +int myFunc (void); + int main (int argc, char *argv[]) { + if (myFunc() == 55) + return 0; + return 1; } diff --git a/test cases/osx/2 library versions/meson.build b/test cases/osx/2 library versions/meson.build index 107b467..b1962ca 100644 --- a/test cases/osx/2 library versions/meson.build +++ b/test cases/osx/2 library versions/meson.build @@ -28,14 +28,14 @@ out = custom_target('library-dependency-hack', # Manually test if the linker can find the above libraries # i.e., whether they were generated with the right naming scheme -executable('manuallink1', out, - link_args : ['-L.', '-lsome']) +test('manually linked 1', executable('manuallink1', out, + link_args : ['-L.', '-lsome'])) -executable('manuallink2', out, - link_args : ['-L.', '-lnoversion']) +test('manually linked 2', executable('manuallink2', out, + link_args : ['-L.', '-lnoversion'])) -executable('manuallink3', out, - link_args : ['-L.', '-lonlyversion']) +test('manually linked 3', executable('manuallink3', out, + link_args : ['-L.', '-lonlyversion'])) -executable('manuallink4', out, - link_args : ['-L.', '-lonlysoversion']) +test('manually linked 4', executable('manuallink4', out, + link_args : ['-L.', '-lonlysoversion'])) diff --git a/test cases/windows/7 mingw dll versioning/exe.orig.c b/test cases/windows/7 mingw dll versioning/exe.orig.c index 1599ebd..86c4adc 100644 --- a/test cases/windows/7 mingw dll versioning/exe.orig.c +++ b/test cases/windows/7 mingw dll versioning/exe.orig.c @@ -1,5 +1,9 @@ +int myFunc (void); + int main (int argc, char *argv[]) { - return 0; + if (myFunc() == 55) + return 0; + return 1; } diff --git a/test cases/windows/8 msvc dll versioning/exe.orig.c b/test cases/windows/8 msvc dll versioning/exe.orig.c index 1599ebd..86c4adc 100644 --- a/test cases/windows/8 msvc dll versioning/exe.orig.c +++ b/test cases/windows/8 msvc dll versioning/exe.orig.c @@ -1,5 +1,9 @@ +int myFunc (void); + int main (int argc, char *argv[]) { - return 0; + if (myFunc() == 55) + return 0; + return 1; } |