General Purpose library for Freestanding C++ and POSIX systems
No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

45 líneas
1.2 KiB

hace 4 años
hace 4 años
  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 "tagfs_test.cpp"
  10. #include "test_scaffold.h"
  11. #include <iostream>
  12. alignas(2048) gp::array<char, 4096> static_mapper::store;
  13. gp::buddy<> static_mapper::impl = gp::buddy<>{store.begin().data, store.size()};
  14. int main()
  15. {
  16. uint failed = 0;
  17. uint runned = 0;
  18. for(auto& test : tests)
  19. {
  20. ++runned;
  21. int value;
  22. try{
  23. value = test->run();
  24. if(value)
  25. {
  26. std::cout << std::dec << test->name << " failed with "<< value << std::endl;
  27. }
  28. } catch (gp::runtime_error err) {
  29. std::cout << test->name << " failed with an exception: " << err.what() << std::endl;
  30. value = -1;
  31. } catch (gp_config::assert_failure err) {
  32. std::cout << test->name << " failed with an assertion failure: " << err.what() << std::endl;
  33. value = -1;
  34. } catch (...) {
  35. std::cout << test->name << " failed with an exception" << std::endl;
  36. value = -1;
  37. }
  38. failed += (value != 0);
  39. }
  40. std::cout << std::dec << "Runned "<<runned<<" tests with "<<failed<<" failures" << std::endl;
  41. return 0;
  42. }