From d1cd99244f96bd95bbd67cc737248df346dec08b Mon Sep 17 00:00:00 2001 From: egor-tensin Date: Thu, 25 Apr 2024 03:50:51 +0000 Subject: =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20egor-tensin/cimp?= =?UTF-8?q?le@8e652dd2cb69928ea1596aa3e59845fef6854e2c=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...nt_main.c.0ff1a98449e6ae22cf540fe28921fa2d.html | 909 +++++++++++++++++++++ 1 file changed, 909 insertions(+) create mode 100644 coverage/index.client_main.c.0ff1a98449e6ae22cf540fe28921fa2d.html (limited to 'coverage/index.client_main.c.0ff1a98449e6ae22cf540fe28921fa2d.html') diff --git a/coverage/index.client_main.c.0ff1a98449e6ae22cf540fe28921fa2d.html b/coverage/index.client_main.c.0ff1a98449e6ae22cf540fe28921fa2d.html new file mode 100644 index 0000000..47d3a69 --- /dev/null +++ b/coverage/index.client_main.c.0ff1a98449e6ae22cf540fe28921fa2d.html @@ -0,0 +1,909 @@ + + + + + + GCC Code Coverage Report + + + + + +

GCC Code Coverage Report

+ +
+ +
+
+ + + + + + + + + + + + + +
Directory:src/
File:src/client_main.c
Date:2024-04-25 03:45:42
+
+
+ + + + + + + + + + + + + + + + + + + +
ExecTotalCoverage
Lines:344379.1%
Branches:101471.4%
+
+
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LineBranchExecSource
1 + /*
2 + * Copyright (c) 2022 Egor Tensin <egor@tensin.name>
3 + * This file is part of the "cimple" project.
4 + * For details, see https://github.com/egor-tensin/cimple.
5 + * Distributed under the MIT License.
6 + */
7 +
8 + #include "client.h"
9 + #include "cmd_line.h"
10 + #include "const.h"
11 + #include "log.h"
12 +
13 + #include <getopt.h>
14 + #include <unistd.h>
15 +
16 + 9214static struct settings default_settings(void)
17 + {
18 + 9214 struct settings settings = {
19 + .host = default_host,
20 + .port = default_port,
21 + };
22 + 9214 return settings;
23 + }
24 +
25 + 6const char *get_usage_string(void)
26 + {
27 + 6 return "[-h|--help] [-V|--version] [-v|--verbose] [-H|--host HOST] [-p|--port PORT] ACTION [ARG...]\n\
28 + \n\
29 + available actions:\n\
30 + \t" CMD_QUEUE_RUN " URL REV - schedule a CI run of repository at URL, revision REV";
31 + }
32 +
33 + 9214static int parse_settings(struct settings *settings, int argc, char *argv[])
34 + {
35 + int opt, longind;
36 +
37 + 9214 *settings = default_settings();
38 +
39 + /* clang-format off */
40 + static struct option long_options[] = {
41 + {"help", no_argument, 0, 'h'},
42 + {"version", no_argument, 0, 'V'},
43 + {"verbose", no_argument, 0, 'v'},
44 + {"host", required_argument, 0, 'H'},
45 + {"port", required_argument, 0, 'p'},
46 + {0, 0, 0, 0},
47 + };
48 + /* clang-format on */
49 +
50 +
+ 2/2 +
+
✓ Branch 1 taken 18422 times.
+
✓ Branch 2 taken 9208 times.
+
+
+
27630 while ((opt = getopt_long(argc, argv, "hVvH:p:", long_options, &longind)) != -1) {
51 +
+ 5/6 +
+
✓ Branch 0 taken 2 times.
+
✓ Branch 1 taken 2 times.
+
✗ Branch 2 not taken.
+
✓ Branch 3 taken 9208 times.
+
✓ Branch 4 taken 9208 times.
+
✓ Branch 5 taken 2 times.
+
+
+
18422 switch (opt) {
52 + 2 case 'h':
53 + 2 exit_with_usage(0);
54 + break;
55 + 2 case 'V':
56 + 2 exit_with_version();
57 + break;
58 + case 'v':
59 + g_log_lvl = LOG_LVL_DEBUG;
60 + break;
61 + 9208 case 'H':
62 + 9208 settings->host = optarg;
63 + 9208 break;
64 + 9208 case 'p':
65 + 9208 settings->port = optarg;
66 + 9208 break;
67 + 2 default:
68 + 2 exit_with_usage(1);
69 + break;
70 + }
71 + }
72 +
73 + 9208 return 0;
74 + }
75 +
76 + 9214int main(int argc, char *argv[])
77 + {
78 + struct settings settings;
79 + 9214 struct client *client = NULL;
80 + 9214 int ret = 0;
81 +
82 + 9214 ret = parse_settings(&settings, argc, argv);
83 +
+ 1/2 +
+
✗ Branch 0 not taken.
+
✓ Branch 1 taken 9208 times.
+
+
+
9208 if (ret < 0)
84 + return ret;
85 +
86 + 9208 ret = client_create(&client);
87 +
+ 1/2 +
+
✗ Branch 0 not taken.
+
✓ Branch 1 taken 9208 times.
+
+
+
9208 if (ret < 0)
88 + return ret;
89 +
90 + 9208 ret = client_main(client, &settings, argc - optind, (const char **)argv + optind);
91 +
+ 1/2 +
+
✓ Branch 0 taken 9206 times.
+
✗ Branch 1 not taken.
+
+
+
9206 if (ret < 0)
92 + goto destroy_client;
93 +
94 + 9206destroy_client:
95 + 9206 client_destroy(client);
96 +
97 + 9206 return ret;
98 + }
99 +
+
+ +
+ + + + -- cgit v1.2.3