Mercurial > hg > vamp-plugin-tester
comparison vamp-plugin-tester.cpp @ 4:d8724c5a6d83
* numbering and clearer output
author | cannam |
---|---|
date | Tue, 17 Mar 2009 17:11:35 +0000 |
parents | 0f65bb22172b |
children | 3019cb6b538d |
comparison
equal
deleted
inserted
replaced
3:0f65bb22172b | 4:d8724c5a6d83 |
---|---|
84 | 84 |
85 if (argc == 1) { | 85 if (argc == 1) { |
86 bool good = true; | 86 bool good = true; |
87 Vamp::HostExt::PluginLoader::PluginKeyList keys = | 87 Vamp::HostExt::PluginLoader::PluginKeyList keys = |
88 Vamp::HostExt::PluginLoader::getInstance()->listPlugins(); | 88 Vamp::HostExt::PluginLoader::getInstance()->listPlugins(); |
89 int notes = 0, warnings = 0, errors = 0; | |
89 for (int i = 0; i < (int)keys.size(); ++i) { | 90 for (int i = 0; i < (int)keys.size(); ++i) { |
90 cout << "Testing plugin: " << keys[i] << endl; | 91 cout << "Testing plugin: " << keys[i] << endl; |
91 Tester tester(keys[i]); | 92 Tester tester(keys[i]); |
92 if (tester.test()) { | 93 if (tester.test(notes, warnings, errors)) { |
93 cout << name << ": All tests succeeded for this plugin" << endl; | 94 cout << name << ": All tests succeeded for this plugin" << endl; |
94 } else { | 95 } else { |
95 cout << name << ": Some tests failed for this plugin" << endl; | 96 cout << name << ": Some tests failed for this plugin" << endl; |
96 good = false; | 97 good = false; |
97 } | 98 } |
98 cout << endl; | 99 cout << endl; |
99 } | 100 } |
100 if (good) { | 101 if (good) { |
101 cout << name << ": All tests succeeded" << endl; | 102 cout << name << ": All tests succeeded"; |
103 if (warnings > 0) { | |
104 cout << ", with " << warnings << " warning(s)"; | |
105 if (notes > 0) { | |
106 cout << " and " << notes << " other note(s)"; | |
107 } | |
108 } else if (notes > 0) { | |
109 cout << ", with " << notes << " note(s)"; | |
110 } | |
111 cout << endl; | |
102 return 0; | 112 return 0; |
103 } else { | 113 } else { |
104 cout << name << ": Some tests failed" << endl; | 114 cout << name << ": Some tests failed" << endl; |
105 return 1; | 115 return 1; |
106 } | 116 } |
107 } else { | 117 } else { |
108 string key = argv[1]; | 118 string key = argv[1]; |
109 Tester tester(key); | 119 Tester tester(key); |
110 if (tester.test()) { | 120 int notes = 0, warnings = 0, errors = 0; |
111 cout << name << ": All tests succeeded" << endl; | 121 if (tester.test(notes, warnings, errors)) { |
122 cout << name << ": All tests succeeded"; | |
123 if (warnings > 0) { | |
124 cout << ", with " << warnings << " warning(s)"; | |
125 if (notes > 0) { | |
126 cout << " and " << notes << " other note(s)"; | |
127 } | |
128 } else if (notes > 0) { | |
129 cout << ", with " << notes << " note(s)"; | |
130 } | |
131 cout << endl; | |
112 return 0; | 132 return 0; |
113 } else { | 133 } else { |
114 cout << name << ": Some tests failed" << endl; | 134 cout << name << ": Some tests failed" << endl; |
115 return 1; | 135 return 1; |
116 } | 136 } |