59 vector<string> expected_files;
60 vector<string> current_files;
62 for(
const auto &dirEntry: std::filesystem::recursive_directory_iterator(
EXPECTED_DIR)){
63 string file_path = dirEntry.path().string();
64 expected_files.push_back(file_path);
66 for(
const auto &dirEntry: std::filesystem::recursive_directory_iterator(
CURRENT_DIR)){
67 string file_path = dirEntry.path().string();
68 current_files.push_back(file_path);
71 sort(expected_files.begin(),expected_files.end());
72 sort(current_files.begin(),current_files.end());
74 int ite = min((
int)expected_files.size(),(
int)current_files.size());
76 for(
int i = 0; i < ite; i++){
77 string expected_file = expected_files[i];
78 string current_file = current_files[i];
83 if(expected_without_prefix != current_without_prefix){
84 if(expected_without_prefix < current_without_prefix){
85 cout <<
"TEST FAILED" <<
'\n';
86 cout <<
"Expected file with name " <<expected_file <<
" but does not exist" <<
'\n';
89 cout <<
"TEST FAILED" <<
'\n';
90 cout <<
"Unexpected file with name " << current_file <<
" found" <<
'\n';
96 cout <<
"TEST FAILED" <<
'\n';
97 cout <<
"File " << expected_file <<
" does not have the expected content" <<
'\n';
101 cout <<
"TEST PASSED" <<
'\n';