summaryrefslogtreecommitdiff
path: root/test/other_tools/git_operations/git_config_run.test.cpp
diff options
context:
space:
mode:
authorPaul Cristian Sarbu <paul.cristian.sarbu@huawei.com>2023-02-21 15:15:59 +0100
committerPaul Cristian Sarbu <paul.cristian.sarbu@huawei.com>2023-03-03 16:21:17 +0100
commit66a6e5186ffd12679b8c3ca6980e11efd74d2f00 (patch)
tree82d731d046ac5ca4205b1b66b3b8df21dd7fed60 /test/other_tools/git_operations/git_config_run.test.cpp
parent2f5654b7f81ac40d7764de59f0e2f343d9e76a0a (diff)
downloadjustbuild-66a6e5186ffd12679b8c3ca6980e11efd74d2f00.tar.gz
test: Add tests for reading in Git proxy settings
Diffstat (limited to 'test/other_tools/git_operations/git_config_run.test.cpp')
-rw-r--r--test/other_tools/git_operations/git_config_run.test.cpp20
1 files changed, 18 insertions, 2 deletions
diff --git a/test/other_tools/git_operations/git_config_run.test.cpp b/test/other_tools/git_operations/git_config_run.test.cpp
index 9a9af9b9..8ffd744a 100644
--- a/test/other_tools/git_operations/git_config_run.test.cpp
+++ b/test/other_tools/git_operations/git_config_run.test.cpp
@@ -93,8 +93,24 @@ auto main(int argc, char* argv[]) -> int {
}
}
else if (test_type == "proxy") {
- Logger::Log(LogLevel::Error, "Proxy tests not yet implemented");
- return 1;
+ auto proxy_info =
+ GitConfigSettings::GetProxySettings(cfg, test_url, logger);
+ if (not proxy_info) {
+ Logger::Log(LogLevel::Error, "Missing proxy_info");
+ return 1;
+ }
+ // check expected result
+ auto expected_result =
+ (argc >= 4) ? std::make_optional<std::string>(args[3])
+ : std::nullopt;
+ auto actual_result = proxy_info.value();
+ if (actual_result != expected_result) {
+ Logger::Log(LogLevel::Error,
+ "Expected test result {}, but obtained {}",
+ expected_result ? *expected_result : "nullopt",
+ actual_result ? *actual_result : "nullopt");
+ return 1;
+ }
}
else {
Logger::Log(LogLevel::Error,