#include "test_term.c"
#include "test_namespace.c"
#include "test_codec_nt.c"
#include "test_store_ht.c"
#include "test_store_mdb.c"
#include "test_graph.c"

int main(int argc, char **argv) {

    // Set env variable to test path.
    putenv ("LSUP_MDB_STORE_PATH=" TMPDIR "/lsup_test_mdb");
    // Clear out database from previous test.
    LSUP_init();

    int rc;

    if (
        term_tests() ||
        namespace_tests() ||
        store_ht_tests() ||
        store_mdb_tests() ||
        graph_tests() ||
        codec_nt_tests() ||
        0
    ) {
        log_error ("Test failed.");
        rc = -1;
    } else {
        log_info ("");
        log_info ("********************");
        log_info ("* ALL TESTS PASSED *");
        log_info ("********************");
        rc = 0;
    }

    log_info ("");
    log_info ("Tests run: %d", tests_run);

    return rc;
}