1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- #include <time.h>
- #include "test_desc.c"
- #define TEST_STORE_PATH TMPDIR "/lsr_test_mdb"
- int main(int argc, char **argv) {
- // Set env variable to test path.
- putenv ("LSUP_MDB_STORE_PATH=" TEST_STORE_PATH);
- // Clear out database from previous test.
- rm_r (TEST_STORE_PATH);
- clock_t start, end;
- double wallclock;
- start = clock();
- int rc = LSR_init();
- if (rc < 0) return rc;
- if (
- desc_tests() ||
- 0
- ) {
- log_error ("Test failed.");
- rc = -1;
- } else {
- log_info ("");
- log_info ("********************");
- log_info ("* ALL TESTS PASSED *");
- log_info ("********************");
- rc = 0;
- }
- end = clock();
- wallclock = (end - start) * 1000 / CLOCKS_PER_SEC;
- log_info ("");
- log_info ("Run %d tests in %lu ms.", tests_run, (size_t) wallclock);
- return rc;
- }
|