regression.cpp 776 B

123456789101112131415161718192021222324252627282930
  1. // Copyright 2009-2021 Intel Corporation
  2. // SPDX-License-Identifier: Apache-2.0
  3. #include "regression.h"
  4. namespace embree
  5. {
  6. /* registerRegressionTest is invoked from static initializers, thus
  7. * we cannot have the regression_tests variable as global static
  8. * variable due to issues with static variable initialization
  9. * order. */
  10. std::vector<RegressionTest*>& get_regression_tests()
  11. {
  12. static std::vector<RegressionTest*> regression_tests;
  13. return regression_tests;
  14. }
  15. void registerRegressionTest(RegressionTest* test)
  16. {
  17. get_regression_tests().push_back(test);
  18. }
  19. RegressionTest* getRegressionTest(size_t index)
  20. {
  21. if (index >= get_regression_tests().size())
  22. return nullptr;
  23. return get_regression_tests()[index];
  24. }
  25. }