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

STEllAR-GROUP / hpx / #853

19 Dec 2022 01:01AM UTC coverage: 86.287% (+0.4%) from 85.912%
#853

push

StellarBot
Merge #6109

6109: Modernize serialization module r=hkaiser a=hkaiser

- flyby separate serialization of Boost types

working towards https://github.com/STEllAR-GROUP/hpx/issues/5497

Co-authored-by: Hartmut Kaiser <hartmut.kaiser@gmail.com>

53 of 53 new or added lines in 6 files covered. (100.0%)

173939 of 201582 relevant lines covered (86.29%)

1931657.12 hits per line

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

0.0
/components/process/src/util/posix/search_path_u.cpp
1
// Copyright (c) 2006, 2007 Julio M. Merino Vidal
2
// Copyright (c) 2008 Ilya Sokolov, Boris Schaeling
3
// Copyright (c) 2009 Boris Schaeling
4
// Copyright (c) 2010 Felipe Tanus, Boris Schaeling
5
// Copyright (c) 2011, 2012 Jeff Flinn, Boris Schaeling
6
// Copyright (c) 2016-2022 Hartmut Kaiser
7
//
8
//  SPDX-License-Identifier: BSL-1.0
9
// Distributed under the Boost Software License, Version 1.0. (See accompanying
10
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
11

12
#include <hpx/config.hpp>
13

14
#if !defined(HPX_WINDOWS)
15
#include <hpx/components/process/util/search_path.hpp>
16
#include <hpx/modules/errors.hpp>
17
#include <hpx/modules/filesystem.hpp>
18
#include <hpx/modules/string_util.hpp>
19

20
#include <unistd.h>
21

22
#include <cstdlib>
23
#include <stdexcept>
24
#include <string>
25

26
namespace hpx { namespace components { namespace process { namespace posix {
27
    std::string search_path(const std::string& filename, std::string path)
×
28
    {
29
        if (path.empty())
×
30
        {
31
            path = ::getenv("PATH");
×
32
            if (path.empty())
×
33
            {
34
                HPX_THROW_EXCEPTION(hpx::error::invalid_status,
×
35
                    "process::search_path",
36
                    "Environment variable PATH not found");
37
            }
38
        }
×
39

40
        std::string result;
×
41
        typedef hpx::string_util::tokenizer<
42
            hpx::string_util::char_separator<char>>
43
            tokenizer;
44
        hpx::string_util::char_separator<char> sep(":");
×
45
        tokenizer tok(path, sep);
×
46
        for (tokenizer::iterator it = tok.begin(); it != tok.end(); ++it)
×
47
        {
48
            filesystem::path p = *it;
×
49
            p /= filename;
×
50
            if (!::access(p.c_str(), X_OK))
×
51
            {
52
                result = p.string();
×
53
                break;
×
54
            }
55
        }
×
56
        return result;
×
57
    }
×
58
}}}}    // namespace hpx::components::process::posix
59

60
#endif
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