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.

46 lines
1.2 KiB

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