1
0

testall.c 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /*******************************************************************************
  2. * This file is part of the argtable3 library.
  3. *
  4. * Copyright (C) 2013-2019 Tom G. Huang
  5. * <tomghuang@gmail.com>
  6. * All rights reserved.
  7. *
  8. * Redistribution and use in source and binary forms, with or without
  9. * modification, are permitted provided that the following conditions are met:
  10. * * Redistributions of source code must retain the above copyright
  11. * notice, this list of conditions and the following disclaimer.
  12. * * Redistributions in binary form must reproduce the above copyright
  13. * notice, this list of conditions and the following disclaimer in the
  14. * documentation and/or other materials provided with the distribution.
  15. * * Neither the name of STEWART HEITMANN nor the names of its contributors
  16. * may be used to endorse or promote products derived from this software
  17. * without specific prior written permission.
  18. *
  19. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  20. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  21. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  22. * ARE DISCLAIMED. IN NO EVENT SHALL STEWART HEITMANN BE LIABLE FOR ANY DIRECT,
  23. * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  24. * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  25. * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  26. * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  27. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  28. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  29. ******************************************************************************/
  30. #include <stdio.h>
  31. #include "CuTest.h"
  32. CuSuite* get_arglit_testsuite();
  33. CuSuite* get_argstr_testsuite();
  34. CuSuite* get_argint_testsuite();
  35. CuSuite* get_argdate_testsuite();
  36. CuSuite* get_argdbl_testsuite();
  37. CuSuite* get_argfile_testsuite();
  38. CuSuite* get_argrex_testsuite();
  39. CuSuite* get_argdstr_testsuite();
  40. CuSuite* get_argcmd_testsuite();
  41. #ifndef ARGTABLE3_TEST_PUBLIC_ONLY
  42. CuSuite* get_arghashtable_testsuite();
  43. #endif
  44. int RunAllTests(void) {
  45. CuString* output = CuStringNew();
  46. CuSuite* suite = CuSuiteNew();
  47. CuSuiteAddSuite(suite, get_arglit_testsuite());
  48. CuSuiteAddSuite(suite, get_argstr_testsuite());
  49. CuSuiteAddSuite(suite, get_argint_testsuite());
  50. CuSuiteAddSuite(suite, get_argdate_testsuite());
  51. CuSuiteAddSuite(suite, get_argdbl_testsuite());
  52. CuSuiteAddSuite(suite, get_argfile_testsuite());
  53. CuSuiteAddSuite(suite, get_argrex_testsuite());
  54. CuSuiteAddSuite(suite, get_argdstr_testsuite());
  55. CuSuiteAddSuite(suite, get_argcmd_testsuite());
  56. #ifndef ARGTABLE3_TEST_PUBLIC_ONLY
  57. CuSuiteAddSuite(suite, get_arghashtable_testsuite());
  58. #endif
  59. CuSuiteRun(suite);
  60. CuSuiteSummary(suite, output);
  61. CuSuiteDetails(suite, output);
  62. printf("%s\n", output->buffer);
  63. return suite->failCount;
  64. }
  65. int main(void) {
  66. return RunAllTests();
  67. }