32#include "BESInternalError.h"
34#include "read_test_baseline.h"
49read_test_baseline(
const string &fn)
52 is.open (fn.c_str(), ios::binary );
55 return "Could not read baseline file: "+fn;
58 is.seekg (0, ios::end);
59 long length = is.tellg();
62 is.seekg (0, ios::beg);
65 vector<char> buffer(length+1);
68 is.read (buffer.data(), length);
70 buffer[length] =
'\0';
72 return string(buffer.data());
75void clean_cache_dir(
const string &cache)
77 string cache_dir = cache +
"/*";
79 string command = string(
"rm ") + cache_dir +
" 2>/dev/null";
81 int status = system(command.c_str());
86 if (status == -1 || status == 127)
87 throw BESInternalError(
"Failed to clean cache dir: " + cache_dir, __FILE__, __LINE__);