/aceunit/src/native/AceUnitData.h

https://github.com/kevinkirkup/cy3240-i2c-bridge · C Header · 87 lines · 25 code · 14 blank · 48 comment · 1 complexity · 883db78531dcea5942247cac44308292 MD5 · raw file

  1. /* Copyright (c) 2007, Christian Hujer
  2. * All rights reserved.
  3. *
  4. * Redistribution and use in source and binary forms, with or without
  5. * modification, are permitted provided that the following conditions are met:
  6. * * Redistributions of source code must retain the above copyright
  7. * notice, this list of conditions and the following disclaimer.
  8. * * Redistributions in binary form must reproduce the above copyright
  9. * notice, this list of conditions and the following disclaimer in the
  10. * documentation and/or other materials provided with the distribution.
  11. * * Neither the name of the AceUnit developers nor the
  12. * names of its contributors may be used to endorse or promote products
  13. * derived from this software without specific prior written permission.
  14. *
  15. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  16. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  17. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  18. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
  19. * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  20. * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  21. * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  22. * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
  23. * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  24. * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  25. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  26. */
  27. #ifndef ACEUNITDATA_H
  28. /** Include shield to protect the header file from being included more than once. */
  29. #define ACEUNITDATA_H 1
  30. #include "AceUnit.h"
  31. /** AceUnitData header file.
  32. * This is only needed when you need to access information used by the runner.
  33. * @author <a href="mailto:cher@riedquat.de">Christian Hujer</a>
  34. * @file AceUnitData.h
  35. */
  36. /** Structure with test execution information, used by the Runner and the Assertions. */
  37. typedef struct {
  38. /** The most recent error will be remembered here.
  39. * This variable will be set by {@link #recordError()} and read by {@link #runFixture()}.
  40. * It is set to NULL before each test case.
  41. * If it is not NULL after a test case, the test case failed.
  42. */
  43. AssertionError_t *recentError;
  44. /** This is the most recent error. */
  45. AssertionError_t recentErrorData;
  46. /** The id of the currently executed test case.
  47. * This variable will be set by {@link #runFixture()} and read by {@link #recordError()}.
  48. */
  49. TestCaseId_t currentTestId;
  50. /** The number of test cases that were executed. */
  51. uint16_t testCaseCount;
  52. /** The number of test cases that failed. */
  53. uint16_t testCaseFailureCount;
  54. #if ACEUNIT_ASSERTION_STYLE == ACEUNIT_ASSERTION_STYLE_LONGJMP
  55. /** Jump Buffer for AceUnit to abort a test case and jump back to the runner. */
  56. jmp_buf jmpBuf;
  57. #endif
  58. #ifdef ACEUNIT_EXPLICIT_MESSAGES
  59. /** The temporary buffer for message formatting. */
  60. #ifdef ACEUNIT_EXPLICIT_MESSAGES_INLINE_BUFFER
  61. char explicitMsgBuf[ACEUNIT_EXPLICIT_MSG_BUF_SIZE];
  62. #else
  63. char *explicitMsgBuf;
  64. #endif
  65. #endif
  66. #ifdef ACEUNIT_RUNNERDATA_EXTENSION
  67. /* Extension hook to add your own fields to AceUnitRunnerData_t. */
  68. ACEUNIT_RUNNERDATA_EXTENSION
  69. #endif
  70. } AceUnitRunnerData_t;
  71. /** The test execution information, used by the Runner and the Assertions. */
  72. extern AceUnitRunnerData_t *runnerData;
  73. #endif /* ACEUNITDATA_H */