Skip to content

Commit

Permalink
chore: allow skipping of FUSE tests (should help with gh #214)
Browse files Browse the repository at this point in the history
  • Loading branch information
mhx committed May 7, 2024
1 parent 7fe45a0 commit 2cb5542
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion test/tools_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
#include <fmt/format.h>

#include "dwarfs/file_stat.h"
#include "dwarfs/util.h"
#include "dwarfs/xattr.h"

#include "test_helpers.h"
Expand Down Expand Up @@ -312,6 +313,10 @@ bool compare_directories(fs::path const& p1, fs::path const& p2,
return rv;
}

bool skip_fuse_tests() {
return dwarfs::getenv_is_enabled("DWARFS_SKIP_FUSE_TESTS");
}

#ifdef _WIN32
struct new_process_group : public ::boost::process::detail::handler_base {
template <class WindowsExecutor>
Expand Down Expand Up @@ -909,6 +914,10 @@ TEST_P(tools_test, end_to_end) {

unicode_symlink = mountpoint / unicode_symlink_name;

if (skip_fuse_tests()) {
drivers.clear();
}

for (auto const& driver : drivers) {
{
scoped_no_leak_check no_leak_check;
Expand Down Expand Up @@ -1140,6 +1149,10 @@ TEST_P(tools_test, end_to_end) {
TEST_P(tools_test, mutating_and_error_ops) {
auto mode = GetParam();

if (skip_fuse_tests()) {
GTEST_SKIP() << "skipping FUSE tests";
}

std::chrono::seconds const timeout{5};
folly::test::TemporaryDirectory tempdir("dwarfs");
auto td = fs::path(tempdir.path().string());
Expand Down Expand Up @@ -1413,7 +1426,7 @@ TEST_P(tools_test, categorize) {
EXPECT_LT(image_size_recompressed, image_size);
}

{
if (!skip_fuse_tests()) {
auto mountpoint = td / "mnt";
fs::path driver;

Expand Down

0 comments on commit 2cb5542

Please sign in to comment.