Don't test the collected system errors when configured to not have them
[openssl.git] / test / recipes / 02-test_errstr.t
index 3d806f02acdf3843943e43084d095963244dc160..ef5e2fa357fee07eecd7dc8cd85fd9fed6844eb3 100644 (file)
@@ -9,6 +9,7 @@
 use strict;
 no strict 'refs';               # To be able to use strings as function refs
 use OpenSSL::Test;
+use OpenSSL::Test::Utils;
 use Errno qw(:POSIX);
 use POSIX qw(strerror);
 
@@ -22,6 +23,17 @@ use constant NUM_SYS_STR_REASONS => 127;
 
 setup('test_errstr');
 
+# In a cross compiled situation, there are chances that our
+# application is linked against different C libraries than
+# perl, and may thereby get different error messages for the
+# same error.
+# The safest is not to test under such circumstances.
+plan skip_all => 'This is unsupported for cross compiled configurations'
+    if config('CROSS_COMPILE');
+
+plan skip_all => 'OpenSSL is configured "no-autoerrinit" or "no-err"'
+    if disabled('autoerrinit') || disabled('err');
+
 # These are POSIX error names, which Errno implements as functions
 # (this is documented)
 my @posix_errors = @{$Errno::EXPORT_TAGS{POSIX}};