test.c 657 B

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