test.c 644 B

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