]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
evp_test: add concept of extended tests to evp_test
authorPauli <ppzgs1@gmail.com>
Thu, 13 Feb 2025 22:43:54 +0000 (09:43 +1100)
committerPauli <ppzgs1@gmail.com>
Thu, 20 Feb 2025 00:17:39 +0000 (11:17 +1100)
These tests are not run by default, instead they run when the EVP_TEST_EXTENDED environment variable
has an integer value other than zero.

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/26750)

test/evp_test.c

index 1ec5b7aab17d11cb010b1e663b868e1a5f258524..f781724e659c310347957dd411d9eaed7048b3c4 100644 (file)
@@ -86,6 +86,7 @@ static OSSL_PROVIDER *prov_null = NULL;
 static OSSL_PROVIDER *libprov = NULL;
 static OSSL_LIB_CTX *libctx = NULL;
 static int fips_indicator_callback_unapproved_count = 0;
+static int extended_tests = 0;
 
 /* List of public and private keys */
 static KEY_LIST *private_keys;
@@ -5195,6 +5196,12 @@ start:
             }
         } else if (strcmp(pp->key, "Unapproved") == 0) {
             t->expect_unapproved = 1;
+        } else if (strcmp(pp->key, "Extended-Test") == 0) {
+            if (!extended_tests) {
+                TEST_info("skipping extended test: %s:%d",
+                          t->s.test_file, t->s.start);
+                t->skip = 1;
+            }
         } else {
             /* Must be test specific line: try to parse it */
             int rv = t->meth->parse(t, pp->key, pp->value);
@@ -5279,6 +5286,8 @@ int setup_tests(void)
 
     OPTION_CHOICE o;
 
+    extended_tests = getenv("EVP_TEST_EXTENDED") != NULL;
+
     while ((o = opt_next()) != OPT_EOF) {
         switch (o) {
         case OPT_CONFIG_FILE: