Improve testing of elliptic curve validation
[openssl.git] / test / recipes / 95-test_external_boringssl.t
1 #! /usr/bin/env perl
2 # Copyright 2015-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;
11 use OpenSSL::Test::Utils;
12 use OpenSSL::Test qw/:DEFAULT bldtop_file srctop_file cmdstr/;
13
14 setup("test_external_boringssl");
15
16 plan skip_all => "No external tests in this configuration"
17     if disabled("external-tests");
18
19 plan skip_all => "BoringSSL runner not detected"
20     if !$ENV{BORING_RUNNER_DIR};
21
22 plan tests => 1;
23
24 indir $ENV{BORING_RUNNER_DIR} => sub {
25     ok(filter_run(cmd(["go", "test", "-shim-path",
26                        bldtop_file("test", "ossl_shim", "ossl_shim"),
27                        "-shim-config",
28                        srctop_file("test", "ossl_shim", "ossl_config.json"),
29                        "-pipe", "-allow-unimplemented"])),
30        "running BoringSSL tests");
31 }, create => 0, cleanup => 0;
32
33 # Filter the output so that the "ok" printed by go test doesn't confuse
34 # Test::More. Without that it thinks there has been one more test run than was
35 # planned
36 sub filter_run {
37     my $cmd = cmdstr(shift);
38     open(PIPE, "-|", $cmd);
39     while(<PIPE>) {
40         print STDOUT "go test: ", $_;
41     }
42     close PIPE;
43 }