• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

STEllAR-GROUP / hpx / #856

28 Dec 2022 02:00AM UTC coverage: 86.602% (+0.05%) from 86.55%
#856

push

StellarBot
Merge #6119

6119: Update CMakeLists.txt r=hkaiser a=khuck

updating the default APEX version


Co-authored-by: Kevin Huck <khuck@cs.uoregon.edu>

174566 of 201573 relevant lines covered (86.6%)

1876093.78 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

75.61
/libs/full/command_line_handling/src/late_command_line_handling.cpp
1
//  Copyright (c) 2007-2022 Hartmut Kaiser
2
//
3
//  SPDX-License-Identifier: BSL-1.0
4
//  Distributed under the Boost Software License, Version 1.0. (See accompanying
5
//  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6

7
#include <hpx/assert.hpp>
8
#include <hpx/command_line_handling/late_command_line_handling.hpp>
9
#include <hpx/command_line_handling/parse_command_line.hpp>
10
#include <hpx/modules/command_line_handling_local.hpp>
11
#include <hpx/modules/program_options.hpp>
12
#include <hpx/modules/runtime_configuration.hpp>
13
#include <hpx/type_support/unused.hpp>
14
#include <hpx/util/from_string.hpp>
15

16
#include <cstddef>
17
#include <iostream>
18
#include <string>
19
#include <vector>
20

21
namespace hpx { namespace util {
22

23
    int handle_late_commandline_options(util::runtime_configuration& ini,
594✔
24
        hpx::program_options::options_description const& options,
25
        void (*handle_print_bind)(std::size_t),
26
        [[maybe_unused]] void (*handle_list_parcelports)())
27
    {
28
        // do secondary command line processing, check validity of options only
29
        try
30
        {
31
            std::string unknown_cmd_line(
32
                ini.get_entry("hpx.unknown_cmd_line", ""));
594✔
33
            if (!unknown_cmd_line.empty())
594✔
34
            {
35
                std::string runtime_mode(ini.get_entry("hpx.runtime_mode", ""));
2✔
36

37
                util::commandline_error_mode mode =
2✔
38
                    util::commandline_error_mode::rethrow_on_error;
39
                std::string allow_unknown(
40
                    ini.get_entry("hpx.commandline.allow_unknown", "0"));
2✔
41
                if (allow_unknown != "0")
2✔
42
                    mode = util::commandline_error_mode::allow_unregistered;
1✔
43

44
                hpx::program_options::variables_map vm;
2✔
45
                std::vector<std::string> still_unregistered_options;
2✔
46
                util::parse_commandline(ini, options, unknown_cmd_line, vm,
2✔
47
                    std::size_t(-1), mode,
2✔
48
                    get_runtime_mode_from_name(runtime_mode), nullptr,
2✔
49
                    &still_unregistered_options);
50

51
                hpx::local::detail::set_unknown_commandline_options(
2✔
52
                    ini, still_unregistered_options);
2✔
53
            }
2✔
54

55
            if (hpx::local::detail::handle_full_help(ini, options))
594✔
56
            {
57
                return 1;
×
58
            }
59

60
            // secondary command line handling, looking for --exit and other
61
            // options
62
            std::string cmd_line(hpx::local::detail::get_full_commandline(ini));
594✔
63
            if (!cmd_line.empty())
594✔
64
            {
65
                std::string runtime_mode(ini.get_entry("hpx.runtime_mode", ""));
594✔
66
                hpx::program_options::variables_map vm;
594✔
67

68
                util::parse_commandline(ini, options, cmd_line, vm,
594✔
69
                    std::size_t(-1),
70
                    util::commandline_error_mode::allow_unregistered |
594✔
71
                        util::commandline_error_mode::
72
                            report_missing_config_file,
73
                    get_runtime_mode_from_name(runtime_mode));
594✔
74

75
#if defined(HPX_HAVE_NETWORKING)
76
                if (vm.count("hpx:list-parcel-ports"))
594✔
77
                {
78
                    if (handle_list_parcelports == nullptr)
×
79
                    {
80
                        throw hpx::detail::command_line_error(
×
81
                            "unexpected invalid function for "
82
                            "handle_list_parcelports");
83
                    }
84
                    handle_list_parcelports();
×
85
                }
×
86
#endif
87
                if (hpx::local::detail::handle_late_options(
594✔
88
                        ini, vm, handle_print_bind))
594✔
89
                {
90
                    return 1;
×
91
                }
92
            }
594✔
93
        }
594✔
94
        catch (std::exception const& e)
95
        {
96
            std::cerr
97
                << "handle_late_commandline_options: command line processing: "
×
98
                << e.what() << std::endl;
×
99
            return -1;
×
100
        }
×
101

102
        return 0;
594✔
103
    }
594✔
104
}}    // namespace hpx::util
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc