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.

35 lines
668 B

25 years ago
  1. #include <stdlib.h>
  2. #include <string.h>
  3. #include <cl_io.h>
  4. extern int test_I (int iterations);
  5. extern int test_MI (int iterations);
  6. extern int test_nt (int iterations);
  7. int test_all (int iterations)
  8. {
  9. int error = 0;
  10. error |= test_I(iterations);
  11. error |= test_MI(iterations);
  12. error |= test_nt(iterations);
  13. return error;
  14. }
  15. int main (int argc, char* argv[])
  16. {
  17. int iterations = 10000;
  18. if ((argc >= 3) && !strcmp(argv[1],"-i")) {
  19. iterations = atoi(argv[2]);
  20. argc -= 2; argv += 2;
  21. }
  22. if (argc < 1)
  23. exit(1);
  24. if (!test_all(iterations)) {
  25. fprint (cl_stdout, "Tests passed.\n");
  26. exit(0);
  27. } else {
  28. fprint (cl_stdout, "Tests failed.\n");
  29. exit(1);
  30. }
  31. }