Deleted Added
full compact
selftest.pl (59191) selftest.pl (68651)
1#!/usr/local/bin/perl -w
2#
3# Run the test suite and generate a report
4#
5
6if (! -f "Configure") {
7 print "Please run perl util/selftest.pl in the OpenSSL directory.\n";
8 exit 1;

--- 5 unchanged lines hidden (view full) ---

14my $platform0="??";
15my $platform="??";
16my $options="??";
17my $last="??";
18my $ok=0;
19my $cc="cc";
20my $cversion="??";
21my $sep="-----------------------------------------------------------------------------\n";
1#!/usr/local/bin/perl -w
2#
3# Run the test suite and generate a report
4#
5
6if (! -f "Configure") {
7 print "Please run perl util/selftest.pl in the OpenSSL directory.\n";
8 exit 1;

--- 5 unchanged lines hidden (view full) ---

14my $platform0="??";
15my $platform="??";
16my $options="??";
17my $last="??";
18my $ok=0;
19my $cc="cc";
20my $cversion="??";
21my $sep="-----------------------------------------------------------------------------\n";
22my $not_our_fault="\nPlease ask your system administrator/vendor for more information.\n[Problems with your operating system setup should not be reported\nto the OpenSSL project.]\n";
22
23open(OUT,">$report") or die;
24
25print OUT "OpenSSL self-test report:\n\n";
26
27$uname=`uname -a`;
28$uname="??\n" if $uname eq "";
29

--- 41 unchanged lines hidden (view full) ---

71print OUT "OS (config): $os\n";
72print OUT "Target (default): $platform0\n";
73print OUT "Target: $platform\n";
74print OUT "Compiler: $cversion\n";
75print OUT "\n";
76
77print "Checking compiler...\n";
78if (open(TEST,">cctest.c")) {
23
24open(OUT,">$report") or die;
25
26print OUT "OpenSSL self-test report:\n\n";
27
28$uname=`uname -a`;
29$uname="??\n" if $uname eq "";
30

--- 41 unchanged lines hidden (view full) ---

72print OUT "OS (config): $os\n";
73print OUT "Target (default): $platform0\n";
74print OUT "Target: $platform\n";
75print OUT "Compiler: $cversion\n";
76print OUT "\n";
77
78print "Checking compiler...\n";
79if (open(TEST,">cctest.c")) {
79 print TEST "#include \nmain(){printf(\"Hello world\\n\");}\n";
80 print TEST "#include <stdio.h>\n#include <errno.h>\nmain(){printf(\"Hello world\\n\");}\n";
80 close(TEST);
81 system("$cc -o cctest cctest.c");
82 if (`./cctest` !~ /Hello world/) {
83 print OUT "Compiler doesn't work.\n";
81 close(TEST);
82 system("$cc -o cctest cctest.c");
83 if (`./cctest` !~ /Hello world/) {
84 print OUT "Compiler doesn't work.\n";
85 print OUT $not_our_fault;
84 goto err;
85 }
86 system("ar r cctest.a /dev/null");
87 if (not -f "cctest.a") {
88 print OUT "Check your archive tool (ar).\n";
86 goto err;
87 }
88 system("ar r cctest.a /dev/null");
89 if (not -f "cctest.a") {
90 print OUT "Check your archive tool (ar).\n";
91 print OUT $not_our_fault;
89 goto err;
90 }
91} else {
92 print OUT "Can't create cctest.c\n";
93}
94if (open(TEST,">cctest.c")) {
95 print TEST "#include <openssl/opensslv.h>\nmain(){printf(OPENSSL_VERSION_TEXT);}\n";
96 close(TEST);
97 system("$cc -o cctest -Iinclude cctest.c");
98 $cctest = `./cctest`;
99 if ($cctest !~ /OpenSSL $version/) {
100 if ($cctest =~ /OpenSSL/) {
101 print OUT "#include uses headers from different OpenSSL version!\n";
102 } else {
103 print OUT "Can't compile test program!\n";
104 }
92 goto err;
93 }
94} else {
95 print OUT "Can't create cctest.c\n";
96}
97if (open(TEST,">cctest.c")) {
98 print TEST "#include <openssl/opensslv.h>\nmain(){printf(OPENSSL_VERSION_TEXT);}\n";
99 close(TEST);
100 system("$cc -o cctest -Iinclude cctest.c");
101 $cctest = `./cctest`;
102 if ($cctest !~ /OpenSSL $version/) {
103 if ($cctest =~ /OpenSSL/) {
104 print OUT "#include uses headers from different OpenSSL version!\n";
105 } else {
106 print OUT "Can't compile test program!\n";
107 }
108 print OUT $not_our_fault;
105 goto err;
106 }
107} else {
108 print OUT "Can't create cctest.c\n";
109}
110
111print "Running make...\n";
112if (system("make 2>&1 | tee make.log") > 255) {

--- 15 unchanged lines hidden (view full) ---

128$_=$options;
129s/no-asm//;
130if (/no-/)
131{
132 print OUT "Test skipped.\n";
133 goto err;
134}
135
109 goto err;
110 }
111} else {
112 print OUT "Can't create cctest.c\n";
113}
114
115print "Running make...\n";
116if (system("make 2>&1 | tee make.log") > 255) {

--- 15 unchanged lines hidden (view full) ---

132$_=$options;
133s/no-asm//;
134if (/no-/)
135{
136 print OUT "Test skipped.\n";
137 goto err;
138}
139
140if (`echo 4+1 | bc` != 5)
141{
142 print OUT "Can't run bc! Test skipped.\n";
143 print OUT $not_our_fault;
144 goto err;
145}
146
136print "Running make test...\n";
137if (system("make test 2>&1 | tee maketest.log") > 255)
138 {
139 print OUT "make test failed!\n";
140} else {
141 $ok=1;
142}
143

--- 45 unchanged lines hidden ---
147print "Running make test...\n";
148if (system("make test 2>&1 | tee maketest.log") > 255)
149 {
150 print OUT "make test failed!\n";
151} else {
152 $ok=1;
153}
154

--- 45 unchanged lines hidden ---