]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Make running individual ssl-test easier
authorTodd Short <tshort@akamai.com>
Wed, 25 May 2022 15:39:20 +0000 (11:39 -0400)
committerTodd Short <todd.short@me.com>
Fri, 27 May 2022 18:17:29 +0000 (14:17 -0400)
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/18407)

test/README.ssltest.md
test/recipes/80-test_ssl_new.t

index 81ee7dfdb8d03d843c21f0ee30e2643648be0f38..85a643079918e71bafb2e64ece79b21764ac0d02 100644 (file)
@@ -283,3 +283,14 @@ of the generated `test/ssl-tests/*.cnf` correspond to expected outputs in with
 the default Configure options. To run `ssl_test` manually from the command line
 in a build with a different configuration, you may need to generate the right
 `*.cnf` file from the `*.cnf.in` input first.
+
+Running a test manually via make
+--------------------------------
+
+Individual tests may be run by adding the SSL_TESTS variable to the `make`
+command line. The SSL_TESTS variable is set to the list of input (or ".in")
+files. The values in SSL_TESTS are globbed.
+
+    $ make test TESTS=test_ssl_new SSL_TESTS="0*.cnf.in"
+
+    $ make test TESTS=test_ssl_new SSL_TESTS="01-simple.cnf.in 05-sni.cnf.in"
index a1828094db313859ed6be0d29dacec2c008cde14..5b2557d5a19f57e1e93e1fc7f7d67313ed5bc63e 100644 (file)
@@ -27,15 +27,23 @@ my $no_fips = disabled('fips') || ($ENV{NO_FIPS} // 0);
 
 $ENV{TEST_CERTS_DIR} = srctop_dir("test", "certs");
 
-my @conf_srcs =  glob(srctop_file("test", "ssl-tests", "*.cnf.in"));
+my @conf_srcs = ();
+if (defined $ENV{SSL_TESTS}) {
+    my @conf_list = split(' ', $ENV{SSL_TESTS});
+    foreach my $conf_file (@conf_list) {
+        push (@conf_srcs, glob(srctop_file("test", "ssl-tests", $conf_file)));
+    }
+    plan tests => scalar @conf_srcs;
+} else {
+    @conf_srcs = glob(srctop_file("test", "ssl-tests", "*.cnf.in"));
+    # We hard-code the number of tests to double-check that the globbing above
+    # finds all files as expected.
+    plan tests => 30;
+}
 map { s/;.*// } @conf_srcs if $^O eq "VMS";
 my @conf_files = map { basename($_, ".in") } @conf_srcs;
 map { s/\^// } @conf_files if $^O eq "VMS";
 
-# We hard-code the number of tests to double-check that the globbing above
-# finds all files as expected.
-plan tests => 30;
-
 # Some test results depend on the configuration of enabled protocols. We only
 # verify generated sources in the default configuration.
 my $is_default_tls = (disabled("ssl3") && !disabled("tls1") &&