summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2025-03-03 20:52:47 +0100
committerCarl Hetherington <cth@carlh.net>2025-03-08 00:12:07 +0100
commit27f9ce96db8b800b301ad3b21fb81355e982941a (patch)
treebf516a44edfc970bc3d64e03c603807830d4d555 /test
parent3f2675aab119e55f958563e2fe6949192a2b976d (diff)
Allow configuration of Grok licence via dcpomatic2_cli (#2981).
Diffstat (limited to 'test')
-rw-r--r--test/encode_cli_test.cc26
1 files changed, 25 insertions, 1 deletions
diff --git a/test/encode_cli_test.cc b/test/encode_cli_test.cc
index d857476a6..8ee656277 100644
--- a/test/encode_cli_test.cc
+++ b/test/encode_cli_test.cc
@@ -47,8 +47,11 @@ run(vector<string> const& args, vector<string>& output)
argv[args.size()] = nullptr;
auto error = encode_cli(args.size(), argv.data(), [&output](string s) { output.push_back(s); }, []() { });
+ for (auto i: output) {
+ std::cout << "O:" << i;
+ }
if (error) {
- std::cout << *error << "\n";
+ std::cout << "E:" << *error << "\n";
}
return error;
@@ -99,3 +102,24 @@ BOOST_AUTO_TEST_CASE(encode_cli_with_explicit_encode_command_test)
BOOST_CHECK(find_in_order(output, { "Making DCP for", "Examining content", "OK", "Transcoding DCP", "OK" }));
}
+
+
+#ifdef DCPOMATIC_GROK
+BOOST_AUTO_TEST_CASE(encode_cli_set_grok_licence)
+{
+ boost::filesystem::path config = "build/encode_cli_set_grok_licence";
+ boost::filesystem::remove_all(config);
+ boost::filesystem::create_directories(config);
+ ConfigRestorer cr(config);
+
+ vector<string> output;
+ auto error = run({ "cli", "config", "grok-licence", "12345678ABC" }, 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("Licence"), "12345678ABC");
+}
+#endif
+