@@ -22,7 +22,6 @@ std::string ReadFile(std::filesystem::path path) {
2222void ParseDirectoryName (std::string name,
2323 std::string* translator_name,
2424 std::string* options) {
25-
2625 // Split at the first '_' the first part is the translator name, the second is
2726 // the options.
2827 // The options follows name=value, split by '_', but name can contain '_'.
@@ -38,7 +37,7 @@ void ParseDirectoryName(std::string name,
3837 *translator_name = name.substr (0 , pos);
3938
4039 // Parse a key=value list.
41- while (true ) {
40+ while (true ) {
4241 // Parse the name.
4342 std::string::size_type pos2 = name.find (' =' , pos);
4443 if (pos2 == std::string::npos) {
@@ -66,15 +65,22 @@ void ParseDirectoryName(std::string name,
6665int main (int , const char **) {
6766 int result = EXIT_SUCCESS;
6867 std::string path = test_directory;
69- // std::cout << "test_directory = " << test_directory << std::endl;
7068
7169 for (auto & dir : std::filesystem::directory_iterator (path)) {
7270 std::string translator_name;
7371 std::string options;
7472 ParseDirectoryName (dir.path ().filename (), &translator_name, &options);
73+ std::cout << std::endl
74+ << " ___" << std::setw (30 ) << std::setfill (' _' ) << std::left
75+ << (" " + translator_name + " " ) << std::endl;
76+
77+ if (!options.empty ()) {
78+ std::cout << " [INFO] Options:" << std::endl;
79+ std::cout << options << std::endl;
80+ }
7581
7682 for (auto & test : std::filesystem::directory_iterator (dir.path ())) {
77- std::cout << " [TEST] " << test.path () << std::endl;
83+ std::cout << " [TEST] " << test.path (). filename (). string () << std::endl;
7884 auto translator = FindTranslator (translator_name);
7985 if (!translator) {
8086 std::cout << " Translator " << translator_name << " not found."
@@ -108,9 +114,9 @@ int main(int, const char**) {
108114
109115 // Fix the expected output if it is not correct.
110116 // Uncomment the following lines to create the output file.
111- // std::cout << " [Create output] " << std::endl;
112- // std::cout << output_computed;
113- // std::ofstream(test.path() / "output") << output_computed;
117+ // std::cout << " [Create output] " << std::endl;
118+ // std::cout << output_computed;
119+ // std::ofstream(test.path() / "output") << output_computed;
114120 }
115121 }
116122
0 commit comments