test_main.c 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /* main.c
  2. *
  3. * Copyright (C) 2006-2014 wolfSSL Inc.
  4. *
  5. * This file is part of CyaSSL.
  6. *
  7. * CyaSSL is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 2 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * CyaSSL is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
  20. */
  21. #ifdef HAVE_CONFIG_H
  22. #include <config.h>
  23. #endif
  24. #include <cyassl/ctaocrypt/settings.h>
  25. #if defined(CYASSL_MICROCHIP_PIC32MZ)
  26. #define MICROCHIP_PIC32
  27. #include <xc.h>
  28. #pragma config ICESEL = ICS_PGx2
  29. /* ICE/ICD Comm Channel Select (Communicate on PGEC2/PGED2) */
  30. #include <stdio.h>
  31. #include <stdlib.h>
  32. #include "PIC32MZ-serial.h"
  33. #define SYSTEMConfigPerformance /* void out SYSTEMConfigPerformance(); */
  34. #else
  35. #define PIC32_STARTER_KIT
  36. #include <stdio.h>
  37. #include <stdlib.h>
  38. #include <p32xxxx.h>
  39. #include <plib.h>
  40. #include <sys/appio.h>
  41. #define init_serial() /* void out init_serial() */
  42. #endif
  43. /* func_args from test.h, so don't have to pull in other junk */
  44. typedef struct func_args {
  45. int argc;
  46. char** argv;
  47. int return_code;
  48. } func_args;
  49. /*
  50. * Main driver for CTaoCrypt tests.
  51. */
  52. int main(int argc, char** argv) {
  53. int i ;
  54. init_serial() ; /* initialize PIC32MZ serial I/O */
  55. SYSTEMConfigPerformance(80000000);
  56. DBINIT();
  57. printf("CTaoCrypt Test:\n");
  58. func_args args;
  59. args.argc = argc;
  60. args.argv = argv;
  61. ctaocrypt_test(&args);
  62. if (args.return_code == 0) {
  63. printf("All tests passed!\n");
  64. }
  65. return 0;
  66. }