| 46 | } |
| 47 | |
| 48 | void AutomatedJSONTestSuite::PrepareScene::onStateChanged() |
| 49 | { |
| 50 | // Clear out all files from the training directory |
| 51 | StrList dirContents = fsManager->getDirectoryContents(native(winOS->GetTrainingDirectory())); |
| 52 | for_each(QString filename, dirContents) |
| 53 | { |
| 54 | fsManager->deleteFileByName(filename, true); // delete silently |
| 55 | } |
| 56 | |
| 57 | // Copy files over that we need to the training directory |
| 58 | QDir dataPath = scnManager->JSONTestFilesPath; |
| 59 | QDir desktopPath = scnManager->getWorkingDirectory(); |
| 60 | QString desktopPathStr = native(desktopPath); |
| 61 | QString trainingDir = native(winOS->GetTrainingDirectory()); |
| 62 | |
| 63 | int argc; |
| 64 | LPWSTR *argv = CommandLineToArgvW((LPCWSTR)GetCommandLineA(), &argc); |
| 65 | |
| 66 | StrList dirList = fsManager->getDirectoryContents(native(dataPath)); |
| 67 | for (int i = 0; i < dirList.size(); ++i) |
| 68 | { |
| 69 | QString fileName = filename(dirList[i]); |
| 70 | if (!desktopPath.exists(fileName)) |
| 71 | fsManager->copyFileByName(dirList[i], trainingDir, fileName, false, true); |
| 72 | } |
| 73 | |
| 74 | GLOBAL(skipSavingSceneFile) = true; // This will prevent saving of the scene file |
| 75 | |
| 76 | // Switch BumpTop to use the training directory for now |
| 77 | scnManager->setWorkingDirectory(winOS->GetTrainingDirectory()); |
| 78 | |
| 79 | // Let's clear out the desktop for the demo purposes |
| 80 | ClearBumpTop(); |
| 81 | CreateBumpObjectsFromDirectory(native(winOS->GetTrainingDirectory())); |
| 82 | } |
| 83 | |
| 84 | bool AutomatedJSONTestSuite::PrepareScene::finalizeStateChanged() |
| 85 | { |
nothing calls this directly
no test coverage detected