2015-10-29 19:34:36 +01:00
|
|
|
#include "testutils/CliTest.h"
|
|
|
|
|
|
|
|
using CliTest_ShowingHelp = CliTest;
|
|
|
|
|
2018-02-02 01:08:01 +01:00
|
|
|
using cryfs::ErrorCode;
|
|
|
|
|
2015-10-29 19:34:36 +01:00
|
|
|
TEST_F(CliTest_ShowingHelp, HelpLongOption) {
|
2018-02-02 01:08:01 +01:00
|
|
|
EXPECT_EXIT_WITH_HELP_MESSAGE({"--help"}, "", ErrorCode::Success);
|
2015-10-29 19:34:36 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
TEST_F(CliTest_ShowingHelp, HelpLongOptionTogetherWithOtherOptions) {
|
2018-05-21 01:20:38 +02:00
|
|
|
EXPECT_EXIT_WITH_HELP_MESSAGE({basedir.string().c_str(), mountdir.string().c_str(), "--help"}, "", ErrorCode::Success);
|
2015-10-29 19:34:36 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
TEST_F(CliTest_ShowingHelp, HelpShortOption) {
|
2018-02-02 01:08:01 +01:00
|
|
|
EXPECT_EXIT_WITH_HELP_MESSAGE({"-h"}, "", ErrorCode::Success);
|
2015-10-29 19:34:36 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
TEST_F(CliTest_ShowingHelp, HelpShortOptionTogetherWithOtherOptions) {
|
2018-05-21 01:20:38 +02:00
|
|
|
EXPECT_EXIT_WITH_HELP_MESSAGE({basedir.string().c_str(), mountdir.string().c_str(), "-h"}, "", ErrorCode::Success);
|
2015-10-29 19:34:36 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
TEST_F(CliTest_ShowingHelp, MissingAllOptions) {
|
2018-02-02 01:08:01 +01:00
|
|
|
EXPECT_EXIT_WITH_HELP_MESSAGE({}, "Please specify a base directory", ErrorCode::InvalidArguments);
|
2015-10-29 19:34:36 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
TEST_F(CliTest_ShowingHelp, MissingDir) {
|
2018-05-21 01:20:38 +02:00
|
|
|
EXPECT_EXIT_WITH_HELP_MESSAGE({basedir.string().c_str()}, "Please specify a mount directory", ErrorCode::InvalidArguments);
|
2015-10-29 19:34:36 +01:00
|
|
|
}
|