30 BOOST_REQUIRE_NO_THROW(
Options(
"Test") );
33 BOOST_TEST( options.full_cmd.empty() );
36 BOOST_TEST( options.commit().size() == 40 );
38 TFile::Open(
"input.root",
"RECREATE")->Close();
40 fs::path input, output;
41 BOOST_REQUIRE_NO_THROW( options.input(
"input", &input,
"input ROOT file") );
42 BOOST_REQUIRE_NO_THROW( options.output(
"output", &output,
"output ROOT file") );
46 auto const args =
tokenize(
"exec input.root output.root --unknown");
47 BOOST_REQUIRE_THROW( options(args.size(), args.data()), boost::wrapexcept<po::error> );
52 auto const args =
tokenize(
"exec input.root output.root");
53 BOOST_REQUIRE_NO_THROW( options(args.size(), args.data()) );
54 BOOST_TEST( input ==
"input.root" );
55 BOOST_TEST( output ==
"output.root" );
56 cout << options.full_cmd << endl;
57 BOOST_TEST( !options.full_cmd.empty() );
60 fs::remove(
"output.root");
64 auto const args =
tokenize(
"exec inpu.root output.root");
65 BOOST_REQUIRE_THROW( options(args.size(),args.data()), boost::wrapexcept<fs::filesystem_error> );
70 auto const args =
tokenize(
"exec input.root .");
71 BOOST_REQUIRE_THROW( options(args.size(),args.data()), boost::wrapexcept<fs::filesystem_error> );
76 fs::permissions(
"input.root", fs::perms::owner_read, fs::perm_options::remove);
77 auto const args =
tokenize(
"exec input.root output.root");
78 BOOST_REQUIRE_THROW( options(args.size(),args.data()), boost::wrapexcept<fs::filesystem_error> );
79 fs::permissions(
"input.root", fs::perms::owner_read, fs::perm_options::add);
82 TFile::Open(
"output.root",
"RECREATE")->Close();
86 fs::permissions(
"output.root", fs::perms::owner_write, fs::perm_options::remove);
87 auto const args =
tokenize(
"exec input.root output.root");
88 BOOST_REQUIRE_THROW( options(args.size(),args.data()), boost::wrapexcept<fs::filesystem_error> );
89 fs::permissions(
"output.root", fs::perms::owner_write, fs::perm_options::add);
92 fs::remove(
"input.root");
93 fs::remove(
"output.root");