mirror of
https://github.com/tiennm99/lombok.git
synced 2026-10-14 16:17:34 +00:00
[testing] now easier to identify what failed, by name of test case
test case names now include idempotent/javac/ecj/prettyprint as a prefix to the test case filename.
This commit is contained in:
5 files changed
+26
-8
No files matched your search
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2009-2020 The Project Lombok Authors.
|
||||
* Copyright (C) 2009-2021 The Project Lombok Authors.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -78,6 +78,9 @@ public class DirectoryRunner extends Runner {
|
||||
}
|
||||
|
||||
public abstract boolean expectChanges();
|
||||
public String testNamePrefix() {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
private static final FileFilter JAVA_FILE_FILTER = new FileFilter() {
|
||||
@@ -114,8 +117,7 @@ public class DirectoryRunner extends Runner {
|
||||
Throwable error = null;
|
||||
try {
|
||||
addTests(testClass);
|
||||
}
|
||||
catch (Throwable t) {
|
||||
} catch (Throwable t) {
|
||||
error = t;
|
||||
}
|
||||
this.failure = error;
|
||||
@@ -124,7 +126,7 @@ public class DirectoryRunner extends Runner {
|
||||
private void addTests(Class<?> testClass) throws Exception {
|
||||
for (File file : params.getBeforeDirectory().listFiles(JAVA_FILE_FILTER)) {
|
||||
if (!params.accept(file)) continue;
|
||||
Description testDescription = Description.createTestDescription(testClass, file.getName());
|
||||
Description testDescription = Description.createTestDescription(testClass, this.params.testNamePrefix() + file.getName());
|
||||
description.addChild(testDescription);
|
||||
tests.put(file.getName(), testDescription);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2009-2015 The Project Lombok Authors.
|
||||
* Copyright (C) 2009-2021 The Project Lombok Authors.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -58,4 +58,8 @@ public class TestLombokFilesIdempotent extends DirectoryRunner.TestParams {
|
||||
public boolean expectChanges() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override public String testNamePrefix() {
|
||||
return "idempotent-";
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2009-2015 The Project Lombok Authors.
|
||||
* Copyright (C) 2009-2021 The Project Lombok Authors.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -58,4 +58,8 @@ public class TestSourceFiles extends DirectoryRunner.TestParams {
|
||||
public boolean expectChanges() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override public String testNamePrefix() {
|
||||
return "prettyprint-";
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2009-2015 The Project Lombok Authors.
|
||||
* Copyright (C) 2009-2021 The Project Lombok Authors.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -58,4 +58,8 @@ public class TestWithDelombok extends DirectoryRunner.TestParams {
|
||||
public boolean expectChanges() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override public String testNamePrefix() {
|
||||
return "javac-";
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2009-2015 The Project Lombok Authors.
|
||||
* Copyright (C) 2009-2021 The Project Lombok Authors.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -62,4 +62,8 @@ public class TestWithEcj extends DirectoryRunner.TestParams {
|
||||
public boolean expectChanges() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override public String testNamePrefix() {
|
||||
return "ecj-";
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user