|
30 | 30 | import org.dbsp.sqllogictest.executors.DBSPExecutor; |
31 | 31 | import org.dbsp.sqllogictest.executors.DbspJdbcExecutor; |
32 | 32 | import org.dbsp.util.Linq; |
| 33 | +import org.dbsp.util.Utilities; |
33 | 34 |
|
34 | 35 | import java.io.*; |
| 36 | +import java.nio.file.Files; |
| 37 | +import java.nio.file.Path; |
| 38 | +import java.nio.file.StandardCopyOption; |
35 | 39 | import java.time.LocalDate; |
36 | 40 | import java.util.ArrayList; |
37 | 41 | import java.util.Arrays; |
@@ -73,7 +77,7 @@ public static void rotateTests() throws IOException, ClassNotFoundException { |
73 | 77 |
|
74 | 78 | String wd = System.getProperty("user.dir"); |
75 | 79 | File directory = new File(wd + "/..").getAbsoluteFile(); |
76 | | - System.setProperty("user.dir", directory.getAbsolutePath()); |
| 80 | + System.setProperty("user.dir", directory.getCanonicalPath()); |
77 | 81 | wd = System.getProperty("user.dir"); |
78 | 82 | System.out.println("working directory is " + wd); |
79 | 83 |
|
@@ -141,7 +145,15 @@ public static void main(String[] argv) throws IOException, ClassNotFoundExceptio |
141 | 145 | args = a.toArray(new String[0]); |
142 | 146 | } |
143 | 147 | System.out.println(Arrays.toString(args)); |
144 | | - System.out.println("WD: " + System.getProperty("user.dir")); |
| 148 | + String wd = System.getProperty("user.dir"); |
| 149 | + System.out.println("WD: " + wd); |
| 150 | + Path source = Path.of(wd, "..", "Cargo.lock"); |
| 151 | + File sourceFile = source.toFile().getCanonicalFile(); |
| 152 | + Path destination = Path.of(wd, "temp", "Cargo.lock"); |
| 153 | + File destinationFile = destination.toFile().getCanonicalFile(); |
| 154 | + System.out.println("Copying " + sourceFile.getPath() + " to " + destinationFile.getPath()); |
| 155 | + Utilities.enforce(sourceFile.exists()); |
| 156 | + Files.copy(sourceFile.toPath(), destinationFile.toPath(), StandardCopyOption.REPLACE_EXISTING); |
145 | 157 | OptionsParser parser = new OptionsParser(true, System.out, System.err); |
146 | 158 | parser.registerOption("-skip", "skipCount", "How many tests to skip (for debugging)", o -> { |
147 | 159 | skip.set(Integer.parseInt(o)); |
|
0 commit comments