Skip to content

Commit

Permalink
test: check tool usage
Browse files Browse the repository at this point in the history
  • Loading branch information
mhx committed Dec 24, 2023
1 parent ab54211 commit ee178ac
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/tools_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
* along with dwarfs. If not, see <https://www.gnu.org/licenses/>.
*/

#include <gmock/gmock.h>
#include <gtest/gtest.h>

#include <chrono>
Expand Down Expand Up @@ -670,6 +671,19 @@ TEST_P(tools_test, end_to_end) {
dwarfsextract_tool_arg.push_back("--tool=dwarfsextract");
}

{
auto out = subprocess::check_run(*mkdwarfs_test_bin, mkdwarfs_tool_arg);
ASSERT_TRUE(out);
EXPECT_THAT(*out, ::testing::HasSubstr("Usage:"));
EXPECT_THAT(*out, ::testing::HasSubstr("--long-help"));
}

if (mode == binary_mode::universal_tool) {
auto out = subprocess::check_run(universal_bin);
ASSERT_TRUE(out);
EXPECT_THAT(*out, ::testing::HasSubstr("--tool="));
}

ASSERT_TRUE(fs::create_directory(fsdata_dir));
ASSERT_TRUE(subprocess::check_run(*dwarfsextract_test_bin,
dwarfsextract_tool_arg, "-i",
Expand Down

0 comments on commit ee178ac

Please sign in to comment.