Example #1
0
impl::stream_redirect_fd::stream_redirect_fd(const int fd)
{
    atf_error_t err = atf_process_stream_init_redirect_fd(&m_sb, fd);
    if (atf_is_error(err))
        throw_atf_error(err);
    m_inited = true;
}
Example #2
0
impl::stream_redirect_path::stream_redirect_path(const fs::path& p)
{
    atf_error_t err = atf_process_stream_init_redirect_path(&m_sb, p.c_path());
    if (atf_is_error(err))
        throw_atf_error(err);
    m_inited = true;
}
Example #3
0
impl::stream_inherit::stream_inherit(void)
{
    atf_error_t err = atf_process_stream_init_inherit(&m_sb);
    if (atf_is_error(err))
        throw_atf_error(err);
    m_inited = true;
}
Example #4
0
impl::stream_connect::stream_connect(const int src_fd, const int tgt_fd)
{
    atf_error_t err = atf_process_stream_init_connect(&m_sb, src_fd, tgt_fd);
    if (atf_is_error(err))
        throw_atf_error(err);
    m_inited = true;
}
Example #5
0
impl::stream_capture::stream_capture(void)
{
    atf_error_t err = atf_process_stream_init_capture(&m_sb);
    if (atf_is_error(err))
        throw_atf_error(err);
    m_inited = true;
}
Example #6
0
void
impl::unset(const std::string& name)
{
    atf_error_t err = atf_env_unset(name.c_str());
    if (atf_is_error(err))
        throw_atf_error(err);
}
Example #7
0
void
impl::set(const std::string& name, const std::string& val)
{
    atf_error_t err = atf_env_set(name.c_str(), val.c_str());
    if (atf_is_error(err))
        throw_atf_error(err);
}
Example #8
0
std::auto_ptr< impl::check_result >
impl::exec(const atf::process::argv_array& argva)
{
    atf_check_result_t result;

    atf_error_t err = atf_check_exec_array(argva.exec_argv(), &result);
    if (atf_is_error(err))
        throw_atf_error(err);

    return std::auto_ptr< impl::check_result >(new impl::check_result(&result));
}
Example #9
0
bool
impl::to_bool(const std::string& str)
{
    bool b;

    atf_error_t err = atf_text_to_bool(str.c_str(), &b);
    if (atf_is_error(err))
        throw_atf_error(err);

    return b;
}
Example #10
0
impl::status
impl::child::wait(void)
{
    atf_process_status_t s;

    atf_error_t err = atf_process_child_wait(&m_child, &s);
    if (atf_is_error(err))
        throw_atf_error(err);

    m_waited = true;
    return status(s);
}
Example #11
0
bool
impl::build_c_o(const std::string& sfile, const std::string& ofile,
                const atf::process::argv_array& optargs)
{
    bool success;

    atf_error_t err = atf_check_build_c_o(sfile.c_str(), ofile.c_str(),
                                          optargs.exec_argv(), &success);
    if (atf_is_error(err))
        throw_atf_error(err);

    return success;
}