Paul Bakker | 5121ce5 | 2009-01-03 21:22:43 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Self-test demonstration program |
| 3 | * |
Manuel Pégourié-Gonnard | 6fb8187 | 2015-07-27 11:11:48 +0200 | [diff] [blame] | 4 | * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved |
Manuel Pégourié-Gonnard | 37ff140 | 2015-09-04 14:21:07 +0200 | [diff] [blame] | 5 | * SPDX-License-Identifier: Apache-2.0 |
| 6 | * |
| 7 | * Licensed under the Apache License, Version 2.0 (the "License"); you may |
| 8 | * not use this file except in compliance with the License. |
| 9 | * You may obtain a copy of the License at |
| 10 | * |
| 11 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 12 | * |
| 13 | * Unless required by applicable law or agreed to in writing, software |
| 14 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 15 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 16 | * See the License for the specific language governing permissions and |
| 17 | * limitations under the License. |
Paul Bakker | b96f154 | 2010-07-18 20:36:00 +0000 | [diff] [blame] | 18 | * |
Manuel Pégourié-Gonnard | fe44643 | 2015-03-06 13:17:10 +0000 | [diff] [blame] | 19 | * This file is part of mbed TLS (https://tls.mbed.org) |
Paul Bakker | 5121ce5 | 2009-01-03 21:22:43 +0000 | [diff] [blame] | 20 | */ |
| 21 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 22 | #if !defined(MBEDTLS_CONFIG_FILE) |
Manuel Pégourié-Gonnard | 7f80997 | 2015-03-09 17:05:11 +0000 | [diff] [blame] | 23 | #include "mbedtls/config.h" |
Manuel Pégourié-Gonnard | cef4ad2 | 2014-04-29 12:39:06 +0200 | [diff] [blame] | 24 | #else |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 25 | #include MBEDTLS_CONFIG_FILE |
Manuel Pégourié-Gonnard | cef4ad2 | 2014-04-29 12:39:06 +0200 | [diff] [blame] | 26 | #endif |
Paul Bakker | 5121ce5 | 2009-01-03 21:22:43 +0000 | [diff] [blame] | 27 | |
Manuel Pégourié-Gonnard | 7f80997 | 2015-03-09 17:05:11 +0000 | [diff] [blame] | 28 | #include "mbedtls/entropy.h" |
| 29 | #include "mbedtls/hmac_drbg.h" |
| 30 | #include "mbedtls/ctr_drbg.h" |
| 31 | #include "mbedtls/dhm.h" |
| 32 | #include "mbedtls/gcm.h" |
| 33 | #include "mbedtls/ccm.h" |
| 34 | #include "mbedtls/md2.h" |
| 35 | #include "mbedtls/md4.h" |
| 36 | #include "mbedtls/md5.h" |
| 37 | #include "mbedtls/ripemd160.h" |
| 38 | #include "mbedtls/sha1.h" |
| 39 | #include "mbedtls/sha256.h" |
| 40 | #include "mbedtls/sha512.h" |
| 41 | #include "mbedtls/arc4.h" |
| 42 | #include "mbedtls/des.h" |
| 43 | #include "mbedtls/aes.h" |
| 44 | #include "mbedtls/camellia.h" |
| 45 | #include "mbedtls/base64.h" |
| 46 | #include "mbedtls/bignum.h" |
| 47 | #include "mbedtls/rsa.h" |
| 48 | #include "mbedtls/x509.h" |
| 49 | #include "mbedtls/xtea.h" |
| 50 | #include "mbedtls/pkcs5.h" |
Manuel Pégourié-Gonnard | 7f80997 | 2015-03-09 17:05:11 +0000 | [diff] [blame] | 51 | #include "mbedtls/ecp.h" |
| 52 | #include "mbedtls/timing.h" |
Paul Bakker | 5121ce5 | 2009-01-03 21:22:43 +0000 | [diff] [blame] | 53 | |
Gilles Peskine | 83cd34a | 2017-12-21 11:07:37 +0100 | [diff] [blame^] | 54 | #include <stdlib.h> |
Rich Evans | 18b78c7 | 2015-02-11 14:06:19 +0000 | [diff] [blame] | 55 | #include <stdio.h> |
| 56 | #include <string.h> |
| 57 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 58 | #if defined(MBEDTLS_PLATFORM_C) |
Manuel Pégourié-Gonnard | 7f80997 | 2015-03-09 17:05:11 +0000 | [diff] [blame] | 59 | #include "mbedtls/platform.h" |
Rich Evans | 18b78c7 | 2015-02-11 14:06:19 +0000 | [diff] [blame] | 60 | #else |
| 61 | #include <stdio.h> |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 62 | #define mbedtls_printf printf |
Manuel Pégourié-Gonnard | 7b6dcbe | 2015-06-22 10:48:01 +0200 | [diff] [blame] | 63 | #define mbedtls_snprintf snprintf |
Rich Evans | 18b78c7 | 2015-02-11 14:06:19 +0000 | [diff] [blame] | 64 | #endif |
| 65 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 66 | #if defined(MBEDTLS_MEMORY_BUFFER_ALLOC_C) |
Manuel Pégourié-Gonnard | 7f80997 | 2015-03-09 17:05:11 +0000 | [diff] [blame] | 67 | #include "mbedtls/memory_buffer_alloc.h" |
Paul Bakker | 6e339b5 | 2013-07-03 13:37:05 +0200 | [diff] [blame] | 68 | #endif |
| 69 | |
Manuel Pégourié-Gonnard | 7b6dcbe | 2015-06-22 10:48:01 +0200 | [diff] [blame] | 70 | static int test_snprintf( size_t n, const char ref_buf[10], int ref_ret ) |
| 71 | { |
| 72 | int ret; |
| 73 | char buf[10] = "xxxxxxxxx"; |
Manuel Pégourié-Gonnard | 4b00f08 | 2015-06-26 11:24:32 +0200 | [diff] [blame] | 74 | const char ref[10] = "xxxxxxxxx"; |
Manuel Pégourié-Gonnard | 7b6dcbe | 2015-06-22 10:48:01 +0200 | [diff] [blame] | 75 | |
| 76 | ret = mbedtls_snprintf( buf, n, "%s", "123" ); |
| 77 | if( ret < 0 || (size_t) ret >= n ) |
| 78 | ret = -1; |
| 79 | |
Manuel Pégourié-Gonnard | 4b00f08 | 2015-06-26 11:24:32 +0200 | [diff] [blame] | 80 | if( strncmp( ref_buf, buf, sizeof( buf ) ) != 0 || |
| 81 | ref_ret != ret || |
| 82 | memcmp( buf + n, ref + n, sizeof( buf ) - n ) != 0 ) |
Manuel Pégourié-Gonnard | 7b6dcbe | 2015-06-22 10:48:01 +0200 | [diff] [blame] | 83 | { |
| 84 | return( 1 ); |
| 85 | } |
| 86 | |
| 87 | return( 0 ); |
| 88 | } |
| 89 | |
| 90 | static int run_test_snprintf( void ) |
| 91 | { |
| 92 | return( test_snprintf( 0, "xxxxxxxxx", -1 ) != 0 || |
Manuel Pégourié-Gonnard | 4b00f08 | 2015-06-26 11:24:32 +0200 | [diff] [blame] | 93 | test_snprintf( 1, "", -1 ) != 0 || |
| 94 | test_snprintf( 2, "1", -1 ) != 0 || |
| 95 | test_snprintf( 3, "12", -1 ) != 0 || |
| 96 | test_snprintf( 4, "123", 3 ) != 0 || |
| 97 | test_snprintf( 5, "123", 3 ) != 0 ); |
Manuel Pégourié-Gonnard | 7b6dcbe | 2015-06-22 10:48:01 +0200 | [diff] [blame] | 98 | } |
| 99 | |
Gilles Peskine | 9d7dfb7 | 2017-12-20 20:23:46 +0100 | [diff] [blame] | 100 | #if defined(MBEDTLS_SELF_TEST) |
| 101 | #if defined(MBEDTLS_MEMORY_BUFFER_ALLOC_C) |
| 102 | int mbedtls_memory_buffer_alloc_free_and_self_test( int verbose ) |
| 103 | { |
| 104 | if( verbose != 0 ) |
| 105 | { |
| 106 | #if defined(MBEDTLS_MEMORY_DEBUG) |
| 107 | mbedtls_memory_buffer_alloc_status( ); |
| 108 | #endif |
| 109 | } |
| 110 | mbedtls_memory_buffer_alloc_free( ); |
| 111 | return( mbedtls_memory_buffer_alloc_self_test( verbose ) ); |
| 112 | } |
| 113 | #endif |
| 114 | |
| 115 | typedef struct |
| 116 | { |
| 117 | const char *name; |
| 118 | int ( *function )( int ); |
| 119 | } selftest_t; |
| 120 | |
| 121 | const selftest_t selftests[] = |
| 122 | { |
| 123 | #if defined(MBEDTLS_MD2_C) |
| 124 | {"md2", mbedtls_md2_self_test}, |
| 125 | #endif |
| 126 | #if defined(MBEDTLS_MD4_C) |
| 127 | {"md4", mbedtls_md4_self_test}, |
| 128 | #endif |
| 129 | #if defined(MBEDTLS_MD5_C) |
| 130 | {"md5", mbedtls_md5_self_test}, |
| 131 | #endif |
| 132 | #if defined(MBEDTLS_RIPEMD160_C) |
| 133 | {"ripemd160", mbedtls_ripemd160_self_test}, |
| 134 | #endif |
| 135 | #if defined(MBEDTLS_SHA1_C) |
| 136 | {"sha1", mbedtls_sha1_self_test}, |
| 137 | #endif |
| 138 | #if defined(MBEDTLS_SHA256_C) |
| 139 | {"sha256", mbedtls_sha256_self_test}, |
| 140 | #endif |
| 141 | #if defined(MBEDTLS_SHA512_C) |
| 142 | {"sha512", mbedtls_sha512_self_test}, |
| 143 | #endif |
| 144 | #if defined(MBEDTLS_ARC4_C) |
| 145 | {"arc4", mbedtls_arc4_self_test}, |
| 146 | #endif |
| 147 | #if defined(MBEDTLS_DES_C) |
| 148 | {"des", mbedtls_des_self_test}, |
| 149 | #endif |
| 150 | #if defined(MBEDTLS_AES_C) |
| 151 | {"aes", mbedtls_aes_self_test}, |
| 152 | #endif |
| 153 | #if defined(MBEDTLS_GCM_C) && defined(MBEDTLS_AES_C) |
| 154 | {"gcm", mbedtls_gcm_self_test}, |
| 155 | #endif |
| 156 | #if defined(MBEDTLS_CCM_C) && defined(MBEDTLS_AES_C) |
| 157 | {"ccm", mbedtls_ccm_self_test}, |
| 158 | #endif |
| 159 | #if defined(MBEDTLS_BASE64_C) |
| 160 | {"base64", mbedtls_base64_self_test}, |
| 161 | #endif |
| 162 | #if defined(MBEDTLS_BIGNUM_C) |
| 163 | {"mpi", mbedtls_mpi_self_test}, |
| 164 | #endif |
| 165 | #if defined(MBEDTLS_RSA_C) |
| 166 | {"rsa", mbedtls_rsa_self_test}, |
| 167 | #endif |
| 168 | #if defined(MBEDTLS_X509_USE_C) |
| 169 | {"x509", mbedtls_x509_self_test}, |
| 170 | #endif |
| 171 | #if defined(MBEDTLS_XTEA_C) |
| 172 | {"xtea", mbedtls_xtea_self_test}, |
| 173 | #endif |
| 174 | #if defined(MBEDTLS_CAMELLIA_C) |
| 175 | {"camellia", mbedtls_camellia_self_test}, |
| 176 | #endif |
| 177 | #if defined(MBEDTLS_CTR_DRBG_C) |
| 178 | {"ctr_drbg", mbedtls_ctr_drbg_self_test}, |
| 179 | #endif |
| 180 | #if defined(MBEDTLS_HMAC_DRBG_C) |
| 181 | {"hmac_drbg", mbedtls_hmac_drbg_self_test}, |
| 182 | #endif |
| 183 | #if defined(MBEDTLS_ECP_C) |
| 184 | {"ecp", mbedtls_ecp_self_test}, |
| 185 | #endif |
| 186 | #if defined(MBEDTLS_DHM_C) |
| 187 | {"dhm", mbedtls_dhm_self_test}, |
| 188 | #endif |
| 189 | #if defined(MBEDTLS_ENTROPY_C) |
| 190 | {"entropy", mbedtls_entropy_self_test}, |
| 191 | #endif |
| 192 | #if defined(MBEDTLS_PKCS5_C) |
| 193 | {"pkcs5", mbedtls_pkcs5_self_test}, |
| 194 | #endif |
| 195 | /* Slower test after the faster ones */ |
| 196 | #if defined(MBEDTLS_TIMING_C) |
| 197 | {"timing", mbedtls_timing_self_test}, |
| 198 | #endif |
| 199 | /* Heap test comes last */ |
| 200 | #if defined(MBEDTLS_MEMORY_BUFFER_ALLOC_C) |
| 201 | {"memory_buffer_alloc", mbedtls_memory_buffer_alloc_free_and_self_test}, |
| 202 | #endif |
| 203 | {NULL, NULL} |
| 204 | }; |
| 205 | #endif /* MBEDTLS_SELF_TEST */ |
| 206 | |
Paul Bakker | 5121ce5 | 2009-01-03 21:22:43 +0000 | [diff] [blame] | 207 | int main( int argc, char *argv[] ) |
| 208 | { |
Gilles Peskine | 9d7dfb7 | 2017-12-20 20:23:46 +0100 | [diff] [blame] | 209 | #if defined(MBEDTLS_SELF_TEST) |
| 210 | const selftest_t *test; |
| 211 | #endif /* MBEDTLS_SELF_TEST */ |
Gilles Peskine | a66fb3f | 2017-12-20 18:09:27 +0100 | [diff] [blame] | 212 | char **argp; |
| 213 | int v = 1; /* v=1 for verbose mode */ |
| 214 | int exclude_mode = 0; |
Gilles Peskine | 9d7dfb7 | 2017-12-20 20:23:46 +0100 | [diff] [blame] | 215 | int suites_tested = 0, suites_failed = 0; |
Gilles Peskine | edede44 | 2017-12-15 15:01:27 +0100 | [diff] [blame] | 216 | #if defined(MBEDTLS_MEMORY_BUFFER_ALLOC_C) && defined(MBEDTLS_SELF_TEST) |
Paul Bakker | 6e339b5 | 2013-07-03 13:37:05 +0200 | [diff] [blame] | 217 | unsigned char buf[1000000]; |
| 218 | #endif |
Manuel Pégourié-Gonnard | d14acbc | 2015-05-29 11:26:37 +0200 | [diff] [blame] | 219 | void *pointer; |
| 220 | |
| 221 | /* |
| 222 | * The C standard doesn't guarantee that all-bits-0 is the representation |
| 223 | * of a NULL pointer. We do however use that in our code for initializing |
| 224 | * structures, which should work on every modern platform. Let's be sure. |
| 225 | */ |
| 226 | memset( &pointer, 0, sizeof( void * ) ); |
| 227 | if( pointer != NULL ) |
| 228 | { |
| 229 | mbedtls_printf( "all-bits-zero is not a NULL pointer\n" ); |
Gilles Peskine | 6d51b63 | 2017-12-20 20:25:03 +0100 | [diff] [blame] | 230 | return( EXIT_FAILURE ); |
Manuel Pégourié-Gonnard | d14acbc | 2015-05-29 11:26:37 +0200 | [diff] [blame] | 231 | } |
Paul Bakker | 5121ce5 | 2009-01-03 21:22:43 +0000 | [diff] [blame] | 232 | |
Manuel Pégourié-Gonnard | 7b6dcbe | 2015-06-22 10:48:01 +0200 | [diff] [blame] | 233 | /* |
| 234 | * Make sure we have a snprintf that correctly zero-terminates |
| 235 | */ |
| 236 | if( run_test_snprintf() != 0 ) |
| 237 | { |
| 238 | mbedtls_printf( "the snprintf implementation is broken\n" ); |
Gilles Peskine | 6d51b63 | 2017-12-20 20:25:03 +0100 | [diff] [blame] | 239 | return( EXIT_FAILURE ); |
Manuel Pégourié-Gonnard | 7b6dcbe | 2015-06-22 10:48:01 +0200 | [diff] [blame] | 240 | } |
| 241 | |
Gilles Peskine | a66fb3f | 2017-12-20 18:09:27 +0100 | [diff] [blame] | 242 | for( argp = argv + ( argc >= 1 ? 1 : argc ); *argp != NULL; ++argp ) |
Gilles Peskine | edede44 | 2017-12-15 15:01:27 +0100 | [diff] [blame] | 243 | { |
Gilles Peskine | a66fb3f | 2017-12-20 18:09:27 +0100 | [diff] [blame] | 244 | if( strcmp( *argp, "--quiet" ) == 0 || |
| 245 | strcmp( *argp, "-quiet" ) == 0 || |
| 246 | strcmp( *argp, "-q" ) == 0 ) |
| 247 | { |
| 248 | v = 0; |
| 249 | } |
| 250 | else if( strcmp( *argp, "--exclude" ) == 0 || |
| 251 | strcmp( *argp, "-x" ) == 0 ) |
| 252 | { |
| 253 | exclude_mode = 1; |
| 254 | } |
| 255 | else |
| 256 | break; |
Gilles Peskine | edede44 | 2017-12-15 15:01:27 +0100 | [diff] [blame] | 257 | } |
Gilles Peskine | a66fb3f | 2017-12-20 18:09:27 +0100 | [diff] [blame] | 258 | |
| 259 | if( v != 0 ) |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 260 | mbedtls_printf( "\n" ); |
Paul Bakker | 5121ce5 | 2009-01-03 21:22:43 +0000 | [diff] [blame] | 261 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 262 | #if defined(MBEDTLS_SELF_TEST) |
Paul Bakker | 135b98e | 2011-05-25 11:13:47 +0000 | [diff] [blame] | 263 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 264 | #if defined(MBEDTLS_MEMORY_BUFFER_ALLOC_C) |
| 265 | mbedtls_memory_buffer_alloc_init( buf, sizeof(buf) ); |
Paul Bakker | 6e339b5 | 2013-07-03 13:37:05 +0200 | [diff] [blame] | 266 | #endif |
| 267 | |
Gilles Peskine | a66fb3f | 2017-12-20 18:09:27 +0100 | [diff] [blame] | 268 | if( *argp != NULL && exclude_mode == 0 ) |
Gilles Peskine | 9d7dfb7 | 2017-12-20 20:23:46 +0100 | [diff] [blame] | 269 | { |
Gilles Peskine | edede44 | 2017-12-15 15:01:27 +0100 | [diff] [blame] | 270 | /* Run the specified tests */ |
| 271 | for( ; *argp != NULL; argp++ ) |
Gilles Peskine | 9d7dfb7 | 2017-12-20 20:23:46 +0100 | [diff] [blame] | 272 | { |
Gilles Peskine | edede44 | 2017-12-15 15:01:27 +0100 | [diff] [blame] | 273 | for( test = selftests; test->name != NULL; test++ ) |
| 274 | { |
| 275 | if( !strcmp( *argp, test->name ) ) |
| 276 | { |
| 277 | if( test->function( v ) != 0 ) |
| 278 | { |
| 279 | suites_failed++; |
| 280 | } |
| 281 | suites_tested++; |
| 282 | break; |
| 283 | } |
| 284 | } |
| 285 | if( test->name == NULL ) |
| 286 | { |
| 287 | mbedtls_printf( " Test suite %s not available -> failed\n\n", *argp ); |
| 288 | suites_failed++; |
| 289 | } |
Gilles Peskine | 9d7dfb7 | 2017-12-20 20:23:46 +0100 | [diff] [blame] | 290 | } |
Gilles Peskine | edede44 | 2017-12-15 15:01:27 +0100 | [diff] [blame] | 291 | } |
| 292 | else |
| 293 | { |
Gilles Peskine | a66fb3f | 2017-12-20 18:09:27 +0100 | [diff] [blame] | 294 | /* Run all the tests except excluded ones */ |
Gilles Peskine | edede44 | 2017-12-15 15:01:27 +0100 | [diff] [blame] | 295 | for( test = selftests; test->name != NULL; test++ ) |
| 296 | { |
Gilles Peskine | a66fb3f | 2017-12-20 18:09:27 +0100 | [diff] [blame] | 297 | if( exclude_mode ) |
| 298 | { |
| 299 | char **excluded; |
| 300 | for( excluded = argp; *excluded != NULL; ++excluded ) |
| 301 | { |
| 302 | if( !strcmp( *excluded, test->name ) ) |
| 303 | break; |
| 304 | } |
| 305 | if( *excluded ) |
| 306 | { |
| 307 | if( v ) |
| 308 | mbedtls_printf( " Skip: %s\n", test->name ); |
| 309 | continue; |
| 310 | } |
| 311 | } |
Gilles Peskine | edede44 | 2017-12-15 15:01:27 +0100 | [diff] [blame] | 312 | if( test->function( v ) != 0 ) |
| 313 | { |
| 314 | suites_failed++; |
| 315 | } |
| 316 | suites_tested++; |
| 317 | } |
Gilles Peskine | 9d7dfb7 | 2017-12-20 20:23:46 +0100 | [diff] [blame] | 318 | } |
Manuel Pégourié-Gonnard | 470fc93 | 2014-03-27 20:07:08 +0100 | [diff] [blame] | 319 | |
Paul Bakker | 135b98e | 2011-05-25 11:13:47 +0000 | [diff] [blame] | 320 | #else |
Gilles Peskine | a66fb3f | 2017-12-20 18:09:27 +0100 | [diff] [blame] | 321 | (void) exclude_mode; |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 322 | mbedtls_printf( " MBEDTLS_SELF_TEST not defined.\n" ); |
Paul Bakker | 135b98e | 2011-05-25 11:13:47 +0000 | [diff] [blame] | 323 | #endif |
| 324 | |
Paul Bakker | 5121ce5 | 2009-01-03 21:22:43 +0000 | [diff] [blame] | 325 | if( v != 0 ) |
| 326 | { |
Gilles Peskine | 9d7dfb7 | 2017-12-20 20:23:46 +0100 | [diff] [blame] | 327 | mbedtls_printf( " Executed %d test suites\n\n", suites_tested ); |
Paul Bakker | 6e339b5 | 2013-07-03 13:37:05 +0200 | [diff] [blame] | 328 | |
Gilles Peskine | 9d7dfb7 | 2017-12-20 20:23:46 +0100 | [diff] [blame] | 329 | if( suites_failed > 0) |
| 330 | { |
| 331 | mbedtls_printf( " [ %d tests FAILED ]\n\n", suites_failed ); |
| 332 | } |
| 333 | else |
| 334 | { |
| 335 | mbedtls_printf( " [ All tests passed ]\n\n" ); |
| 336 | } |
Paul Bakker | cce9d77 | 2011-11-18 14:26:47 +0000 | [diff] [blame] | 337 | #if defined(_WIN32) |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 338 | mbedtls_printf( " Press Enter to exit this program.\n" ); |
Paul Bakker | 5121ce5 | 2009-01-03 21:22:43 +0000 | [diff] [blame] | 339 | fflush( stdout ); getchar(); |
| 340 | #endif |
| 341 | } |
Paul Bakker | 5121ce5 | 2009-01-03 21:22:43 +0000 | [diff] [blame] | 342 | |
Gilles Peskine | 9d7dfb7 | 2017-12-20 20:23:46 +0100 | [diff] [blame] | 343 | if( suites_failed > 0) |
| 344 | return( EXIT_FAILURE ); |
| 345 | |
| 346 | return( EXIT_SUCCESS ); |
Paul Bakker | 5121ce5 | 2009-01-03 21:22:43 +0000 | [diff] [blame] | 347 | } |