| 253 | } |
| 254 | |
| 255 | TestStats TestTool::processPath( |
| 256 | TestCreator _testCaseCreator, |
| 257 | TestOptions const& _options, |
| 258 | fs::path const& _basepath, |
| 259 | fs::path const& _path, |
| 260 | solidity::test::Batcher& _batcher |
| 261 | ) |
| 262 | { |
| 263 | std::queue<fs::path> paths; |
| 264 | paths.push(_path); |
| 265 | int successCount = 0; |
| 266 | int testCount = 0; |
| 267 | int skippedCount = 0; |
| 268 | |
| 269 | while (!paths.empty()) |
| 270 | { |
| 271 | auto currentPath = paths.front(); |
| 272 | |
| 273 | fs::path fullpath = _basepath / currentPath; |
| 274 | if (fs::is_directory(fullpath)) |
| 275 | { |
| 276 | paths.pop(); |
| 277 | for (auto const& entry: boost::iterator_range<fs::directory_iterator>( |
| 278 | fs::directory_iterator(fullpath), |
| 279 | fs::directory_iterator() |
| 280 | )) |
| 281 | if (fs::is_directory(entry.path()) || TestCase::isTestFilename(entry.path().filename())) |
| 282 | paths.push(currentPath / entry.path().filename()); |
| 283 | } |
| 284 | else if (m_exitRequested) |
| 285 | { |
| 286 | ++testCount; |
| 287 | paths.pop(); |
| 288 | } |
| 289 | else if (!_batcher.checkAndAdvance()) |
| 290 | { |
| 291 | paths.pop(); |
| 292 | ++skippedCount; |
| 293 | } |
| 294 | else |
| 295 | { |
| 296 | ++testCount; |
| 297 | TestTool testTool( |
| 298 | _testCaseCreator, |
| 299 | _options, |
| 300 | fullpath, |
| 301 | currentPath.generic_path().string() |
| 302 | ); |
| 303 | auto result = testTool.process(); |
| 304 | |
| 305 | switch(result) |
| 306 | { |
| 307 | case Result::Failure: |
| 308 | case Result::Exception: |
| 309 | switch(testTool.handleResponse(result == Result::Exception)) |
| 310 | { |
| 311 | case Request::Quit: |
| 312 | paths.pop(); |
nothing calls this directly
no test coverage detected