Fix death tests in multithreading context
This commit is contained in:
parent
20612fb245
commit
bb90bb19ba
@ -7,6 +7,7 @@ using namespace cryfs::program_options;
|
||||
using std::pair;
|
||||
using std::vector;
|
||||
using std::cerr;
|
||||
using std::endl;
|
||||
using std::string;
|
||||
|
||||
Parser::Parser(int argc, char *argv[]) :_options(_argsToVector(argc, argv)) {}
|
||||
@ -81,6 +82,6 @@ void Parser::_addPositionalOptionForBaseDir(po::options_description *desc, po::p
|
||||
cerr << "Usage: cryfs --config configFile [other options] rootDir mountPoint [-- [FUSE Mount Options]]\n";
|
||||
po::options_description desc;
|
||||
_addAllowedOptions(&desc);
|
||||
cerr << desc << "\n";
|
||||
cerr << desc << endl;
|
||||
exit(1);
|
||||
}
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
namespace cryfs {
|
||||
namespace program_options {
|
||||
class ProgramOptions {
|
||||
class ProgramOptions final {
|
||||
public:
|
||||
ProgramOptions(const std::string &baseDir, const std::string &mountDir, const std::string &configFile, bool foreground, const std::vector<char *> &fuseOptions);
|
||||
~ProgramOptions();
|
||||
|
@ -12,35 +12,38 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
TEST_F(ProgramOptionsParserTest, MissingAllOptions) {
|
||||
class ProgramOptionsParserDeathTest: public ProgramOptionsParserTest {};
|
||||
|
||||
TEST_F(ProgramOptionsParserDeathTest, MissingAllOptions) {
|
||||
EXPECT_DEATH(
|
||||
parse({"./myExecutable"}),
|
||||
"Usage:"
|
||||
parse({"./myExecutable"}),
|
||||
"Usage:"
|
||||
);
|
||||
std::cout << "exited" << std::endl;
|
||||
}
|
||||
|
||||
TEST_F(ProgramOptionsParserTest, MissingDir) {
|
||||
TEST_F(ProgramOptionsParserDeathTest, MissingDir) {
|
||||
EXPECT_DEATH(
|
||||
parse({"./myExecutable", "/home/user/baseDir"}),
|
||||
"Usage:"
|
||||
);
|
||||
}
|
||||
|
||||
TEST_F(ProgramOptionsParserTest, ConfigFileMissing) {
|
||||
TEST_F(ProgramOptionsParserDeathTest, ConfigFileMissing) {
|
||||
EXPECT_DEATH(
|
||||
parse({"./myExecutable", "/home/user/baseDir", "/home/user/mountDir"}),
|
||||
"Usage:"
|
||||
);
|
||||
}
|
||||
|
||||
TEST_F(ProgramOptionsParserTest, HelpLongOption) {
|
||||
TEST_F(ProgramOptionsParserDeathTest, HelpLongOption) {
|
||||
EXPECT_DEATH(
|
||||
parse({"./myExecutable", "--help"}),
|
||||
"Usage:"
|
||||
);
|
||||
}
|
||||
|
||||
TEST_F(ProgramOptionsParserTest, HelpShortOption) {
|
||||
TEST_F(ProgramOptionsParserDeathTest, HelpShortOption) {
|
||||
EXPECT_DEATH(
|
||||
parse({"./myExecutable", "-h"}),
|
||||
"Usage:"
|
||||
|
Loading…
Reference in New Issue
Block a user