Add a test to dynamically load and unload the libraries
[oweals/openssl.git] / test / recipes / 90-test_shlibload.t
1 #! /usr/bin/env perl
2 # Copyright 2016 The OpenSSL Project Authors. All Rights Reserved.
3 #
4 # Licensed under the OpenSSL license (the "License").  You may not use
5 # this file except in compliance with the License.  You can obtain a copy
6 # in the file LICENSE in the source distribution or at
7 # https://www.openssl.org/source/license.html
8
9
10 use OpenSSL::Test qw/:DEFAULT bldtop_dir/;
11 use OpenSSL::Test::Utils;
12
13 #Load configdata.pm
14
15 BEGIN {
16     setup("test_shlibload");
17 }
18 use lib bldtop_dir('.');
19 use configdata;
20
21 plan skip_all => "Test only supported in a shared build" if disabled("shared");
22
23 plan tests => 3;
24
25 ok(run(test(["shlibloadtest", "-crypto_first",
26              $unified_info{sharednames}->{libcrypto},
27              $unified_info{sharednames}->{libssl}])),
28    "running shlibloadtest -crypto_first");
29 ok(run(test(["shlibloadtest", "-ssl_first",
30              $unified_info{sharednames}->{libcrypto},
31              $unified_info{sharednames}->{libssl}])),
32    "running shlibloadtest -ssl_first");
33 ok(run(test(["shlibloadtest", "-just_crypto",
34              $unified_info{sharednames}->{libcrypto},
35              $unified_info{sharednames}->{libssl}])),
36    "running shlibloadtest -just_crypto");
37