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.

38 lines
700 B

25 years ago
25 years ago
25 years ago
25 years ago
25 years ago
  1. #include <cstdlib>
  2. #include <cstring>
  3. #include <cln/io.h>
  4. extern int test_I (int iterations);
  5. extern int test_MI (int iterations);
  6. extern int test_nt (int iterations);
  7. using namespace std;
  8. using namespace cln;
  9. int test_all (int iterations)
  10. {
  11. int error = 0;
  12. error |= test_I(iterations);
  13. error |= test_MI(iterations);
  14. error |= test_nt(iterations);
  15. return error;
  16. }
  17. int main (int argc, char* argv[])
  18. {
  19. int iterations = 10000;
  20. if ((argc >= 3) && !::strcmp(argv[1],"-i")) {
  21. iterations = atoi(argv[2]);
  22. argc -= 2; argv += 2;
  23. }
  24. if (argc < 1)
  25. exit(1);
  26. if (!test_all(iterations)) {
  27. cout << "Tests passed." << endl;
  28. exit(0);
  29. } else {
  30. cout << "Tests failed." << endl;
  31. exit(1);
  32. }
  33. }