From 2f83c206888bc0573e767f16457d7e926b978bee Mon Sep 17 00:00:00 2001 From: Marcus Holland-Moritz Date: Fri, 22 Dec 2023 21:37:16 +0100 Subject: [PATCH] test: mkdwarfs with different --progress and --log-level options But not on Windows, because subprocesses suck on Windows. --- test/dwarfs_tools.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/test/dwarfs_tools.cpp b/test/dwarfs_tools.cpp index 390e392e3..de61db183 100644 --- a/test/dwarfs_tools.cpp +++ b/test/dwarfs_tools.cpp @@ -700,6 +700,26 @@ TEST_P(tools_test, end_to_end) { ASSERT_TRUE(fs::exists(image)); ASSERT_GT(fs::file_size(image), 1000); +#ifndef _WIN32 + { + auto image2 = td / "test2.dwarfs"; + + ASSERT_TRUE(subprocess::check_run( + *mkdwarfs_test_bin, mkdwarfs_tool_arg, "-i", fsdata_dir, "-o", image2, + "--progress=simple", "--log-level=debug")); + + ASSERT_TRUE(fs::exists(image2)); + ASSERT_GT(fs::file_size(image2), 1000); + + ASSERT_TRUE(subprocess::check_run( + *mkdwarfs_test_bin, mkdwarfs_tool_arg, "-i", fsdata_dir, "-o", image2, + "--progress=ascii", "--log-level=trace", "--force")); + + ASSERT_TRUE(fs::exists(image2)); + ASSERT_GT(fs::file_size(image2), 1000); + } +#endif + ASSERT_TRUE(subprocess::check_run( *mkdwarfs_test_bin, mkdwarfs_tool_arg, "-i", image, "-o", image_hdr, "--no-progress", "--recompress=none", "--header", header_data)); @@ -1195,7 +1215,12 @@ TEST_P(tools_test, categorize) { fsdata_dir.string(), "-o", image.string(), +#ifdef _WIN32 "--no-progress", +#else + "--progress=ascii", + "--log-level=verbose", +#endif "--categorize", "-S", "16",