32#include "BESInternalError.h"
34#include "read_test_baseline.h"
49read_test_baseline(
const string &fn)
54 is.open (fn.c_str(), ios::binary );
57 return "Could not read baseline file: "+fn;
60 is.seekg (0, ios::end);
64 is.seekg (0, ios::beg);
67 vector<char> buffer(length+1);
70 is.read (buffer.data(), length);
72 buffer[length] =
'\0';
74 return string(buffer.data());
77void clean_cache_dir(
const string &cache)
79 string cache_dir = cache +
"/*";
81 string command = string(
"rm ") + cache_dir +
" 2>/dev/null";
83 int status = system(command.c_str());
88 if (status == -1 || status == 127)
89 throw BESInternalError(
"Failed to clean cache dir: " + cache_dir, __FILE__, __LINE__);
exception thrown if internal error encountered