summaryrefslogtreecommitdiffstats
path: root/contrib/atf/atf-c++/detail/test_helpers.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/atf/atf-c++/detail/test_helpers.cpp')
-rw-r--r--contrib/atf/atf-c++/detail/test_helpers.cpp41
1 files changed, 0 insertions, 41 deletions
diff --git a/contrib/atf/atf-c++/detail/test_helpers.cpp b/contrib/atf/atf-c++/detail/test_helpers.cpp
index 107b45a..d13b124 100644
--- a/contrib/atf/atf-c++/detail/test_helpers.cpp
+++ b/contrib/atf/atf-c++/detail/test_helpers.cpp
@@ -27,10 +27,6 @@
// IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
-extern "C" {
-#include <regex.h>
-}
-
#include <fstream>
#include <iostream>
#include <string>
@@ -92,43 +88,6 @@ get_process_helpers_path(const atf::tests::tc& tc, bool is_detail)
".." / "atf-c" / "detail" / "process_helpers";
}
-bool
-grep_file(const char* name, const char* regex)
-{
- std::ifstream is(name);
- ATF_REQUIRE(is);
-
- bool found = false;
-
- std::string line;
- std::getline(is, line);
- while (!found && is.good()) {
- if (grep_string(line, regex))
- found = true;
- else
- std::getline(is, line);
- }
-
- return found;
-}
-
-bool
-grep_string(const std::string& str, const char* regex)
-{
- int res;
- regex_t preg;
-
- std::cout << "Looking for '" << regex << "' in '" << str << "'\n";
- ATF_REQUIRE(::regcomp(&preg, regex, REG_EXTENDED) == 0);
-
- res = ::regexec(&preg, str.c_str(), 0, NULL, 0);
- ATF_REQUIRE(res == 0 || res == REG_NOMATCH);
-
- ::regfree(&preg);
-
- return res == 0;
-}
-
void
test_helpers_detail::check_equal(const char* expected[],
const string_vector& actual)
OpenPOWER on IntegriCloud