OLD | NEW |
1 #!/usr/local/bin/perl -w | 1 #!/usr/local/bin/perl -w |
2 # | 2 # |
3 # Run the test suite and generate a report | 3 # Run the test suite and generate a report |
4 # | 4 # |
5 | 5 |
6 if (! -f "Configure") { | 6 if (! -f "Configure") { |
7 print "Please run perl util/selftest.pl in the OpenSSL directory.\n"; | 7 print "Please run perl util/selftest.pl in the OpenSSL directory.\n"; |
8 exit 1; | 8 exit 1; |
9 } | 9 } |
10 | 10 |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 print OUT "Options: $options\n" if $options ne ""; | 71 print OUT "Options: $options\n" if $options ne ""; |
72 print OUT "OS (uname): $uname"; | 72 print OUT "OS (uname): $uname"; |
73 print OUT "OS (config): $os\n"; | 73 print OUT "OS (config): $os\n"; |
74 print OUT "Target (default): $platform0\n"; | 74 print OUT "Target (default): $platform0\n"; |
75 print OUT "Target: $platform\n"; | 75 print OUT "Target: $platform\n"; |
76 print OUT "Compiler: $cversion\n"; | 76 print OUT "Compiler: $cversion\n"; |
77 print OUT "\n"; | 77 print OUT "\n"; |
78 | 78 |
79 print "Checking compiler...\n"; | 79 print "Checking compiler...\n"; |
80 if (open(TEST,">cctest.c")) { | 80 if (open(TEST,">cctest.c")) { |
81 print TEST "#include <stdio.h>\n#include <errno.h>\nmain(){printf(\"Hello wo
rld\\n\");}\n"; | 81 print TEST "#include <stdio.h>\n#include <stdlib.h>\n#include <errno.h>\nmai
n(){printf(\"Hello world\\n\");}\n"; |
82 close(TEST); | 82 close(TEST); |
83 system("$cc -o cctest cctest.c"); | 83 system("$cc -o cctest cctest.c"); |
84 if (`./cctest` !~ /Hello world/) { | 84 if (`./cctest` !~ /Hello world/) { |
85 print OUT "Compiler doesn't work.\n"; | 85 print OUT "Compiler doesn't work.\n"; |
86 print OUT $not_our_fault; | 86 print OUT $not_our_fault; |
87 goto err; | 87 goto err; |
88 } | 88 } |
89 system("ar r cctest.a /dev/null"); | 89 system("ar r cctest.a /dev/null"); |
90 if (not -f "cctest.a") { | 90 if (not -f "cctest.a") { |
91 print OUT "Check your archive tool (ar).\n"; | 91 print OUT "Check your archive tool (ar).\n"; |
92 print OUT $not_our_fault; | 92 print OUT $not_our_fault; |
93 goto err; | 93 goto err; |
94 } | 94 } |
95 } else { | 95 } else { |
96 print OUT "Can't create cctest.c\n"; | 96 print OUT "Can't create cctest.c\n"; |
97 } | 97 } |
98 if (open(TEST,">cctest.c")) { | 98 if (open(TEST,">cctest.c")) { |
99 print TEST "#include <openssl/opensslv.h>\nmain(){printf(OPENSSL_VERSION_TEX
T);}\n"; | 99 print TEST "#include <stdio.h>\n#include <stdlib.h>\n#include <openssl/opens
slv.h>\nmain(){printf(OPENSSL_VERSION_TEXT);}\n"; |
100 close(TEST); | 100 close(TEST); |
101 system("$cc -o cctest -Iinclude cctest.c"); | 101 system("$cc -o cctest -Iinclude cctest.c"); |
102 $cctest = `./cctest`; | 102 $cctest = `./cctest`; |
103 if ($cctest !~ /OpenSSL $version/) { | 103 if ($cctest !~ /OpenSSL $version/) { |
104 if ($cctest =~ /OpenSSL/) { | 104 if ($cctest =~ /OpenSSL/) { |
105 print OUT "#include uses headers from different OpenSSL version!\n"; | 105 print OUT "#include uses headers from different OpenSSL version!\n"; |
106 } else { | 106 } else { |
107 print OUT "Can't compile test program!\n"; | 107 print OUT "Can't compile test program!\n"; |
108 } | 108 } |
109 print OUT $not_our_fault; | 109 print OUT $not_our_fault; |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 open(IN,"<$report") or die; | 192 open(IN,"<$report") or die; |
193 while (<IN>) { | 193 while (<IN>) { |
194 if (/$sep/) { | 194 if (/$sep/) { |
195 print "[...]\n"; | 195 print "[...]\n"; |
196 last; | 196 last; |
197 } | 197 } |
198 print; | 198 print; |
199 } | 199 } |
200 print "\nTest report in file $report\n"; | 200 print "\nTest report in file $report\n"; |
201 | 201 |
OLD | NEW |