mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-02 00:24:13 +08:00
mdbx-test: implement cleanup().
This commit is contained in:
parent
c6edd6fb91
commit
68241762e7
@ -176,7 +176,7 @@ function probe {
|
||||
echo "=============================================== $(date)"
|
||||
echo "${caption}: $*"
|
||||
rm -f ${TESTDB_DIR}/* \
|
||||
&& ${VALGRIND} ./mdbx_test --ignore-dbfull --repeat=3 --pathname=${TESTDB_DIR}/long.db "$@" | lz4 > ${TESTDB_DIR}/long.log.lz4 \
|
||||
&& ${VALGRIND} ./mdbx_test --ignore-dbfull --repeat=3 --pathname=${TESTDB_DIR}/long.db "$@" --cleanup-after=no | lz4 > ${TESTDB_DIR}/long.log.lz4 \
|
||||
&& ${VALGRIND} ./mdbx_chk -nvvv ${TESTDB_DIR}/long.db | tee ${TESTDB_DIR}/long-chk.log \
|
||||
&& ([ ! -e ${TESTDB_DIR}/long.db-copy ] || ${VALGRIND} ./mdbx_chk -nvvv ${TESTDB_DIR}/long.db-copy | tee ${TESTDB_DIR}/long-chk-copy.log) \
|
||||
|| (echo "FAILED"; exit 1)
|
||||
|
@ -209,7 +209,11 @@ std::string thunk_param(const actor_config &config) {
|
||||
|
||||
void cleanup() {
|
||||
log_trace(">> cleanup");
|
||||
/* TODO: remove each database */
|
||||
for (const auto &db_path : global::databases) {
|
||||
int err = osal_removefile(db_path);
|
||||
if (err != MDBX_SUCCESS && err != MDBX_ENOFILE)
|
||||
failure_perror(db_path.c_str(), err);
|
||||
}
|
||||
log_trace("<< cleanup");
|
||||
}
|
||||
|
||||
@ -587,7 +591,7 @@ int main(int argc, char *const argv[]) {
|
||||
}
|
||||
|
||||
log_notice("RESULT: %s\n", failed ? "Failed" : "Successful");
|
||||
if (global::config::cleanup_before) {
|
||||
if (global::config::cleanup_after) {
|
||||
if (failed)
|
||||
log_verbose("skip cleanup");
|
||||
else
|
||||
|
Loading…
x
Reference in New Issue
Block a user