🛠️🐜 Antkeeper superbuild with dependencies included https://antkeeper.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

64 lines
2.0 KiB

  1. /* See COPYING.txt for the full license governing this code. */
  2. /**
  3. * \file SDL_visualtest_exhaustive_variator.h
  4. *
  5. * Header for the exhaustive variator.
  6. */
  7. #include "SDL_visualtest_harness_argparser.h"
  8. #include "SDL_visualtest_variator_common.h"
  9. #ifndef SDL_visualtest_exhaustive_variator_h_
  10. #define SDL_visualtest_exhaustive_variator_h_
  11. /* Set up for C function definitions, even when using C++ */
  12. #ifdef __cplusplus
  13. extern "C" {
  14. #endif
  15. /**
  16. * Struct for the variator that exhaustively iterates through all variations of
  17. * command line arguments to the SUT.
  18. */
  19. typedef struct SDLVisualTest_ExhaustiveVariator
  20. {
  21. /*! The current variation. */
  22. SDLVisualTest_Variation variation;
  23. /*! Configuration object for the SUT that the variator is running for. */
  24. SDLVisualTest_SUTConfig config;
  25. /*! Buffer to store the arguments string built from the variation */
  26. char buffer[MAX_SUT_ARGS_LEN];
  27. } SDLVisualTest_ExhaustiveVariator;
  28. /**
  29. * Initializes the variator.
  30. *
  31. * \return 1 on success, 0 on failure
  32. */
  33. int SDLVisualTest_InitExhaustiveVariator(SDLVisualTest_ExhaustiveVariator* variator,
  34. SDLVisualTest_SUTConfig* config);
  35. /**
  36. * Gets the arguments string for the next variation using the variator and updates
  37. * the variator's current variation object to the next variation.
  38. *
  39. * \return The arguments string representing the next variation on success, and
  40. * NULL on failure or if we have iterated through all possible variations.
  41. * In the latter case subsequent calls will start the variations again from
  42. * the very beginning. The pointer returned should not be freed.
  43. */
  44. char* SDLVisualTest_GetNextExhaustiveVariation(SDLVisualTest_ExhaustiveVariator* variator);
  45. /**
  46. * Frees any resources associated with the variator.
  47. */
  48. void SDLVisualTest_FreeExhaustiveVariator(SDLVisualTest_ExhaustiveVariator* variator);
  49. /* Ends C function definitions when using C++ */
  50. #ifdef __cplusplus
  51. }
  52. #endif
  53. #endif /* SDL_visualtest_exhaustive_variator_h_ */
  54. /* vi: set ts=4 sw=4 expandtab: */