mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-08 10:16:03 +02:00
Better test error messages when workspace is not empty after test
On GHA the error does not really give a good indication of what went wrong with minimal to no stack traces Part of #117
This commit is contained in:
parent
320bb231c2
commit
a9c0153bf7
1 changed files with 4 additions and 2 deletions
|
@ -156,7 +156,8 @@ public abstract class BaseTestCase5 {
|
||||||
public static void assertWorkspaceIsEmpty() throws CoreException {
|
public static void assertWorkspaceIsEmpty() throws CoreException {
|
||||||
IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
|
IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
|
||||||
// use lists because error messages are nicer
|
// use lists because error messages are nicer
|
||||||
assertEquals(List.of(), Arrays.asList(root.members()));
|
assertEquals(List.of(), Arrays.asList(root.members()),
|
||||||
|
"Found projects in workspace. This test or an earlier test did not clean up after itself.");
|
||||||
|
|
||||||
File workspaceFile = root.getLocation().toFile();
|
File workspaceFile = root.getLocation().toFile();
|
||||||
|
|
||||||
|
@ -169,7 +170,8 @@ public abstract class BaseTestCase5 {
|
||||||
assertEquals(List.of(), Arrays.asList(file.list()));
|
assertEquals(List.of(), Arrays.asList(file.list()));
|
||||||
permitted.add("tmp");
|
permitted.add("tmp");
|
||||||
}
|
}
|
||||||
assertEquals(List.of(), Arrays.asList(workspaceFile.list((dir, name) -> !permitted.contains(name))));
|
assertEquals(List.of(), Arrays.asList(workspaceFile.list((dir, name) -> !permitted.contains(name))),
|
||||||
|
"Found files in workspace directory. This test or an earlier test did not clean up after itself.");
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void deleteOnTearDown(File file) {
|
protected void deleteOnTearDown(File file) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue