(String name, String filesPath, String path, Results results)
| 152 | } |
| 153 | |
| 154 | public static void runTest(String name, String filesPath, String path, Results results) throws IOException { |
| 155 | File rootPath = new File(path+File.separator+"root"); |
| 156 | if (rootPath.exists()) { |
| 157 | deleteDir(rootPath); |
| 158 | } |
| 159 | rootPath.mkdir(); |
| 160 | File copiedFilesPath = new File(path+File.separator+"root"+File.separator+"files"); |
| 161 | copyFolder(new File(filesPath).toPath(), copiedFilesPath.toPath()); |
| 162 | |
| 163 | String[] installLines = getLines(path + File.separator+"Install.txt"); |
| 164 | String[] installLines2 = getLines(path + File.separator+"Install2.txt"); |
| 165 | String[] playLines = getLines(path + File.separator+"Play.txt"); |
| 166 | |
| 167 | long startTime = System.currentTimeMillis(); |
| 168 | if (installLines.length>0) { |
| 169 | if (installLines.length<2) { |
| 170 | throw new IOException(path+File.separator+"Install.txt needs to have 2 lines"); |
| 171 | } |
| 172 | runBoxedWine(name, path, "install", installLines, results); |
| 173 | if (results.exitCode!=111) { |
| 174 | return; |
| 175 | } |
| 176 | } |
| 177 | if (installLines2.length>0) { |
| 178 | if (installLines2.length<2) { |
| 179 | throw new IOException(path+File.separator+"Install2.txt needs to have 2 lines"); |
| 180 | } |
| 181 | runBoxedWine(name, path, "install2", installLines2, results); |
| 182 | if (results.exitCode!=111) { |
| 183 | return; |
| 184 | } |
| 185 | } |
| 186 | String parseFile = null; |
| 187 | String parseKey = null; |
| 188 | |
| 189 | if (playLines.length>0) { |
| 190 | if (playLines.length<2) { |
| 191 | throw new IOException(path+File.separator+"Play.txt needs to have 2 lines"); |
| 192 | } |
| 193 | if (playLines[0].startsWith("PARSE_FILE=")) { |
| 194 | parseFile = playLines[0].substring(11); |
| 195 | String[] tmp = new String[playLines.length - 1]; |
| 196 | for (int i=0;i<playLines.length - 1;i++) { |
| 197 | tmp[i] = playLines[1+i]; |
| 198 | } |
| 199 | playLines = tmp; |
| 200 | } |
| 201 | if (playLines[0].startsWith("PARSE_KEY=")) { |
| 202 | parseKey = playLines[0].substring(10); |
| 203 | String[] tmp = new String[playLines.length - 1]; |
| 204 | for (int i=0;i<playLines.length - 1;i++) { |
| 205 | tmp[i] = playLines[1+i]; |
| 206 | } |
| 207 | playLines = tmp; |
| 208 | } |
| 209 | runBoxedWine(name, path, "play", playLines, results); |
| 210 | } |
| 211 | results.timeToComplete = (int)((System.currentTimeMillis()-startTime)/1000); |
no test coverage detected