55 vector<string> expected_files;
56 vector<string> current_files;
58 for(
const auto &dirEntry: std::filesystem::recursive_directory_iterator(
EXPECTED_DIR)){
59 string file_path = dirEntry.path().string();
60 expected_files.push_back(file_path);
62 for(
const auto &dirEntry: std::filesystem::recursive_directory_iterator(
CURRENT_DIR)){
63 string file_path = dirEntry.path().string();
64 current_files.push_back(file_path);
67 sort(expected_files.begin(),expected_files.end());
68 sort(current_files.begin(),current_files.end());
70 int ite = min((
int)expected_files.size(),(
int)current_files.size());
72 for(
int i = 0; i < ite; i++){
73 string expected_file = expected_files[i];
74 string current_file = current_files[i];
79 if(expected_without_prefix != current_without_prefix){
80 if(expected_without_prefix < current_without_prefix){
81 cout <<
"TEST FAILED" <<
'\n';
82 cout <<
"Expected file with name " <<expected_file <<
" but does not exist" <<
'\n';
85 cout <<
"TEST FAILED" <<
'\n';
86 cout <<
"Unexpected file with name " << current_file <<
" found" <<
'\n';
92 cout <<
"TEST FAILED" <<
'\n';
93 cout <<
"File " << expected_file <<
" does not have the expected content" <<
'\n';
97 cout <<
"TEST PASSED" <<
'\n';