Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use tmpdir in callback and auxiliary tests #43

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions tests/fdb/api/test_auxiliary.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "eckit/testing/Test.h"
#include "eckit/filesystem/TmpDir.h"
#include "metkit/mars/MarsRequest.h"
#include "fdb5/api/FDB.h"
#include "fdb5/api/helpers/FDBToolRequest.h"
Expand Down Expand Up @@ -64,8 +65,10 @@ std::set<eckit::PathName> setup(FDB& fdb) {

CASE("Wipe with extensions") {

::setenv("FDB_AUX_EXTENSIONS", "foo,bar", 1);
eckit::TmpDir tmpdir;
eckit::testing::SetEnv env_config{"FDB_ROOT_DIRECTORY", tmpdir.asString().c_str()};

eckit::testing::SetEnv env_extensions{"FDB_AUX_EXTENSIONS", "foo,bar"};
FDB fdb;
std::set<eckit::PathName> auxPaths = setup(fdb);
EXPECT(auxPaths.size() == 6);
Expand All @@ -91,8 +94,10 @@ CASE("Wipe with extensions") {

CASE("Purge with extensions") {

::setenv("FDB_AUX_EXTENSIONS", "foo,bar", 1);
eckit::TmpDir tmpdir;
eckit::testing::SetEnv env_config{"FDB_ROOT_DIRECTORY", tmpdir.asString().c_str()};

eckit::testing::SetEnv env_extensions{"FDB_AUX_EXTENSIONS", "foo,bar"};
std::set<eckit::PathName> auxPathsDelete;

// Archive the same data three times
Expand Down
5 changes: 5 additions & 0 deletions tests/fdb/api/test_callback.cc
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
#include "eckit/testing/Test.h"
#include "eckit/filesystem/TmpDir.h"
#include "fdb5/api/FDB.h"

namespace fdb5::test {

//----------------------------------------------------------------------------------------------------------------------
CASE("Archive and flush callback") {

eckit::TmpDir tmpdir;
eckit::testing::SetEnv env_config{"FDB_ROOT_DIRECTORY", tmpdir.asString().c_str()};

FDB fdb;

std::string data_str = "Raining cats and dogs";
Expand Down
Loading