vici_tests.c 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*
  2. * Copyright (C) 2014 Martin Willi
  3. * Copyright (C) 2014 revosec AG
  4. *
  5. * This program is free software; you can redistribute it and/or modify it
  6. * under the terms of the GNU General Public License as published by the
  7. * Free Software Foundation; either version 2 of the License, or (at your
  8. * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
  9. *
  10. * This program is distributed in the hope that it will be useful, but
  11. * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
  12. * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
  13. * for more details.
  14. */
  15. #include <test_runner.h>
  16. #include <daemon.h>
  17. /* declare test suite constructors */
  18. #define TEST_SUITE(x) test_suite_t* x();
  19. #include "vici_tests.h"
  20. #undef TEST_SUITE
  21. static test_configuration_t tests[] = {
  22. #define TEST_SUITE(x) \
  23. { .suite = x, },
  24. #include "vici_tests.h"
  25. { .suite = NULL, }
  26. };
  27. static bool test_runner_init(bool init)
  28. {
  29. if (!init)
  30. {
  31. lib->processor->set_threads(lib->processor, 0);
  32. lib->processor->cancel(lib->processor);
  33. }
  34. return TRUE;
  35. }
  36. int main(int argc, char *argv[])
  37. {
  38. return test_runner_run("vici", tests, test_runner_init);
  39. }