aboutsummaryrefslogtreecommitdiffstats
path: root/Configurations
diff options
context:
space:
mode:
authorJakub Zelenka <[email protected]>2026-06-20 14:06:09 +0200
committerTomas Mraz <[email protected]>2026-07-09 19:38:28 +0200
commitacd7679800cd766bd855c4995a3d3799be9e2516 (patch)
treefefd6e793f6a32de572c65197203f163157e1980 /Configurations
parentDeprecate unit-test configure option and SSL_test_functions (diff)
downloadopenssl-acd7679800cd766bd855c4995a3d3799be9e2516.tar.gz
openssl-acd7679800cd766bd855c4995a3d3799be9e2516.zip
Add unit testing cmocka based framework
This adds the unit testing framework that extends the build so it can be enabled and tests are built. It is executed as part of the test using a recipe which executes all unit tests. The documentation is added with more info about writing the unit tests. Assisted-by: Claude:claude-opus-4-8 Reviewed-by: Richard Levitte <[email protected]> Reviewed-by: Tomas Mraz <[email protected]> MergeDate: Thu Jul 9 17:39:14 2026 (Merged from https://github.com/openssl/openssl/pull/30788)
Diffstat (limited to 'Configurations')
-rw-r--r--Configurations/unix-Makefile.tmpl6
1 files changed, 5 insertions, 1 deletions
diff --git a/Configurations/unix-Makefile.tmpl b/Configurations/unix-Makefile.tmpl
index 19455e2b112..f8e44e73f7d 100644
--- a/Configurations/unix-Makefile.tmpl
+++ b/Configurations/unix-Makefile.tmpl
@@ -504,6 +504,8 @@ BIN_LDFLAGS={- join(' ', $target{bin_lflags} || (),
'$(CNF_LDFLAGS)', '$(LDFLAGS)') -}
BIN_EX_LIBS=$(CNF_EX_LIBS) $(EX_LIBS)
+CMOCKA_LIBS={- $config{cmocka_libs} // '' -}
+
# CPPFLAGS_Q is used for one thing only: to build up buildinf.h
CPPFLAGS_Q={- $cppflags1 =~ s|([\\"])|\\$1|g;
$cppflags2 =~ s|([\\"])|\\$1|g;
@@ -2022,11 +2024,13 @@ EOF
}
}
my $wrapflags = '';
+ my $cmocka = '';
if (defined $unified_info{wraps}->{$args{bin}}) {
$wrapflags = join(' ',
map { "-Wl,--wrap=$_" }
@{$unified_info{wraps}->{$args{bin}}});
$wrapflags = ' ' . $wrapflags;
+ $cmocka = ' $(CMOCKA_LIBS)';
}
my $linkflags = join("", map { $_." " } @linkdirs);
my $linklibs = join("", map { $_." " } @linklibs);
@@ -2048,7 +2052,7 @@ $bin: $deps
\$\${LDCMD:-$cmd} $cmdflags $linkflags\$(BIN_LDFLAGS)$wrapflags \\
-o $bin \\
$objs \\
- $linklibs\$(BIN_EX_LIBS)
+ $linklibs\$(BIN_EX_LIBS)$cmocka
EOF
}
sub in2script {