General Purpose library for Freestanding C++ and POSIX systems
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.

40 lines
1.1 KiB

4 years ago
  1. #include "test_scaffold.h"
  2. #include "gp_config.hpp"
  3. #include "meta_test.cpp"
  4. #include "gp_test.cpp"
  5. #include "bloomfilter.cpp"
  6. #include "quotient_filter.cpp"
  7. #include "pair_test.cpp"
  8. #include <iostream>
  9. alignas(2048) gp::array<char, 4096> static_mapper::store;
  10. gp::buddy<> static_mapper::impl = gp::buddy<>{store.begin().data, store.size()};
  11. int main()
  12. {
  13. uint failed = 0;
  14. uint runned = 0;
  15. for(auto& test : tests)
  16. {
  17. ++runned;
  18. int value;
  19. try{
  20. value = test->run();
  21. if(value)
  22. {
  23. std::cout << std::dec << test->name << " failed with "<< value << std::endl;
  24. }
  25. } catch (gp::runtime_error err) {
  26. std::cout << test->name << " failed with an exception: " << err.what() << std::endl;
  27. value = -1;
  28. } catch (gp_config::assert_failure err) {
  29. std::cout << test->name << " failed with an assertion failure: " << err.what() << std::endl;
  30. value = -1;
  31. } catch (...) {
  32. std::cout << test->name << " failed with an exception" << std::endl;
  33. value = -1;
  34. }
  35. failed += (value != 0);
  36. }
  37. std::cout << std::dec << "Runned "<<runned<<" tests with "<<failed<<" failures" << std::endl;
  38. return 0;
  39. }