test.c 862 B

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