summaryrefslogtreecommitdiff
path: root/test/encode_cli_test.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2025-03-03 22:10:56 +0100
committerCarl Hetherington <cth@carlh.net>2025-03-08 00:12:07 +0100
commit641f5f2f61b77d79cb1e8c737cda0766b1ee2de8 (patch)
tree6195f00f8e48e64dc8765d62604a9d8056191de0 /test/encode_cli_test.cc
parent27f9ce96db8b800b301ad3b21fb81355e982941a (diff)
Support some more grok configuration in the dcpomatic2_cli.
Diffstat (limited to 'test/encode_cli_test.cc')
-rw-r--r--test/encode_cli_test.cc38
1 files changed, 38 insertions, 0 deletions
diff --git a/test/encode_cli_test.cc b/test/encode_cli_test.cc
index 8ee656277..0a0a17e3a 100644
--- a/test/encode_cli_test.cc
+++ b/test/encode_cli_test.cc
@@ -121,5 +121,43 @@ BOOST_AUTO_TEST_CASE(encode_cli_set_grok_licence)
check.read_file(config / "2.18" / "config.xml");
BOOST_CHECK_EQUAL(check.node_child("Grok")->string_child("Licence"), "12345678ABC");
}
+
+
+BOOST_AUTO_TEST_CASE(encode_cli_enable_grok)
+{
+ boost::filesystem::path config = "build/encode_cli_enable_grok";
+ boost::filesystem::remove_all(config);
+ boost::filesystem::create_directories(config);
+ ConfigRestorer cr(config);
+
+ for (auto value: vector<string>{ "1", "0"}) {
+ vector<string> output;
+ auto error = run({ "cli", "config", "grok-enable", value }, output);
+ BOOST_CHECK(output.empty());
+ BOOST_CHECK(!error);
+
+ cxml::Document check("Config");
+ check.read_file(config / "2.18" / "config.xml");
+ BOOST_CHECK_EQUAL(check.node_child("Grok")->string_child("Enable"), value);
+ }
+}
+
+
+BOOST_AUTO_TEST_CASE(encode_cli_set_grok_binary_location)
+{
+ boost::filesystem::path config = "build/encode_cli_set_grok_binary_location";
+ boost::filesystem::remove_all(config);
+ boost::filesystem::create_directories(config);
+ ConfigRestorer cr(config);
+
+ vector<string> output;
+ auto error = run({ "cli", "config", "grok-binary-location", "foo/bar/baz" }, output);
+ BOOST_CHECK(output.empty());
+ BOOST_CHECK(!error);
+
+ cxml::Document check("Config");
+ check.read_file(config / "2.18" / "config.xml");
+ BOOST_CHECK_EQUAL(check.node_child("Grok")->string_child("BinaryLocation"), "foo/bar/baz");
+}
#endif