2015-10-29 19:34:36 +01:00
|
|
|
#include "testutils/CliTest.h"
|
|
|
|
|
|
|
|
using CliTest_ShowingHelp = CliTest;
|
|
|
|
|
|
|
|
TEST_F(CliTest_ShowingHelp, HelpLongOption) {
|
|
|
|
EXPECT_EXIT_WITH_HELP_MESSAGE({"--help"});
|
|
|
|
}
|
|
|
|
|
|
|
|
TEST_F(CliTest_ShowingHelp, HelpLongOptionTogetherWithOtherOptions) {
|
2015-10-29 20:17:52 +01:00
|
|
|
EXPECT_EXIT_WITH_HELP_MESSAGE({basedir->path().c_str(), mountdir->path().c_str(), "--help"});
|
2015-10-29 19:34:36 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
TEST_F(CliTest_ShowingHelp, HelpShortOption) {
|
|
|
|
EXPECT_EXIT_WITH_HELP_MESSAGE({"-h"});
|
|
|
|
}
|
|
|
|
|
|
|
|
TEST_F(CliTest_ShowingHelp, HelpShortOptionTogetherWithOtherOptions) {
|
2015-10-29 20:17:52 +01:00
|
|
|
EXPECT_EXIT_WITH_HELP_MESSAGE({basedir->path().c_str(), mountdir->path().c_str(), "-h"});
|
2015-10-29 19:34:36 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
TEST_F(CliTest_ShowingHelp, MissingAllOptions) {
|
|
|
|
EXPECT_EXIT_WITH_HELP_MESSAGE({});
|
|
|
|
}
|
|
|
|
|
|
|
|
TEST_F(CliTest_ShowingHelp, MissingDir) {
|
2015-10-29 20:17:52 +01:00
|
|
|
EXPECT_EXIT_WITH_HELP_MESSAGE({basedir->path().c_str()});
|
2015-10-29 19:34:36 +01:00
|
|
|
}
|