test.c 714 B

1234567891011121314151617181920212223242526272829303132333435
  1. #include "test_term.c"
  2. #include "test_namespace.c"
  3. #include "test_store_ht.c"
  4. #include "test_store_mdb.c"
  5. #include "test_graph.c"
  6. int main(int argc, char **argv) {
  7. // Set env variable to test path.
  8. putenv ("LSUP_MDB_STORE_PATH=" TMPDIR "/lsup_test_mdb");
  9. // Clear out database from previous test.
  10. rm_r (getenv ("LSUP_MDB_STORE_PATH"));
  11. int rc;
  12. if (
  13. term_tests() ||
  14. namespace_tests() ||
  15. store_ht_tests() ||
  16. store_mdb_tests() ||
  17. graph_tests() ||
  18. 0
  19. ) {
  20. printf("Test failed.");
  21. rc = -1;
  22. } else {
  23. printf("ALL TESTS PASSED\n");
  24. rc = 0;
  25. }
  26. printf("Tests run: %d\n", tests_run);
  27. return rc;
  28. }