Beispiel #1
0
atf::fs::path
get_process_helpers_path(const atf::tests::tc& tc, bool is_detail)
{
    if (is_detail)
        return atf::fs::path(tc.get_config_var("srcdir")) /
               ".." / ".." / "atf-c" / "detail" / "process_helpers";
    else
        return atf::fs::path(tc.get_config_var("srcdir")) /
               ".." / "atf-c" / "detail" / "process_helpers";
}
Beispiel #2
0
atf::fs::path
get_process_helpers_path(const atf::tests::tc& tc, bool is_detail)
{
    const char* helper = "detail/process_helpers";
    if (atf_c_tests_base == NULL) {
        if (is_detail)
            return atf::fs::path(tc.get_config_var("srcdir")) /
                   ".." / ".." / "atf-c" / helper;
        else
            return atf::fs::path(tc.get_config_var("srcdir")) /
                   ".." / "atf-c" / helper;
    } else {
        return atf::fs::path(atf_c_tests_base) / helper;
    }
}
Beispiel #3
0
bool
build_check_cxx_o_srcdir(const atf::tests::tc& tc, const char* sfile)
{
    const atf::fs::path sfilepath =
        atf::fs::path(tc.get_config_var("srcdir")) / sfile;
    return build_check_cxx_o(sfilepath.c_str());
}
Beispiel #4
0
void
build_check_cxx_o(const atf::tests::tc& tc, const char* sfile,
                  const char* failmsg, const bool expect_pass)
{
    const atf::fs::path sfilepath =
        atf::fs::path(tc.get_config_var("srcdir")) / sfile;
    build_check_cxx_o_aux(sfilepath, failmsg, expect_pass);
}
Beispiel #5
0
// XXX Should this string handling and verbosity level be part of the
// ATF_REQUIRE_EQ macro?  It may be hard to predict sometimes that a
// string can have newlines in it, and so the error message generated
// at the moment will be bogus if there are some.
static
void
check_equal(const atf::tests::tc& tc, const std::string& str,
            const std::string& exp)
{
    if (str != exp) {
        std::cout << "String equality check failed.\n"
            "Adding >> and << to delimit the string boundaries below.\n";
        std::cout << "GOT:\n";
        print_indented(str);
        std::cout << "EXPECTED:\n";
        print_indented(exp);
        tc.fail("Constructed string differs from the expected one");
    }
}
static
atf::fs::path
get_helper(const atf::tests::tc& tc, const char* name)
{
    return atf::fs::path(tc.get_config_var("srcdir")) / name;
}