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.

44 lines
1.1 KiB

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