Skip to content

Commit

Permalink
Remove old tests (#4767)
Browse files Browse the repository at this point in the history
* Make tests error when non-Exception Throwable during runtime

* 1.18 test updated to 1.18.2
Removed tests 1.9, 1.10, 1.11 and 1.12
  • Loading branch information
TPGamesNL authored Jun 13, 2022
1 parent 31e2755 commit 0c74e07
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 57 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ void createTestTask(String name, String environments, boolean devMode) {
}

// Register different Skript testing tasks
createTestTask('quickTest', 'src/test/skript/environments/main/paper-1.18.1.json', false)
createTestTask('quickTest', 'src/test/skript/environments/main/paper-1.18.2.json', false)
createTestTask('skriptTest', 'src/test/skript/environments/main', false)
createTestTask('skriptTestFull', 'src/test/skript/environments/', false)
createTestTask('skriptTestDev', 'src/test/skript/environments/main/' + (project.property('testEnv') == null
Expand Down
10 changes: 9 additions & 1 deletion src/main/java/ch/njol/skript/Skript.java
Original file line number Diff line number Diff line change
Expand Up @@ -1575,7 +1575,15 @@ public static EmptyStacktraceException exception(final @Nullable Throwable cause
* Set to true when an exception is thrown.
*/
private static boolean errored = false;


/**
* Mark that an exception has occurred at some point during runtime.
* Only used for Skript's testing system.
*/
public static void markErrored() {
errored = true;
}

/**
* Used if something happens that shouldn't happen
*
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/ch/njol/skript/lang/TriggerItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ public static boolean walk(final TriggerItem start, final Event e) {
} catch (final Exception ex) {
if (ex.getStackTrace().length != 0) // empty exceptions have already been printed
Skript.exception(ex, i);
} catch (Throwable throwable) {
// not all Throwables are Exceptions, but we usually don't want to catch them (without rethrowing)
Skript.markErrored();
throw throwable;
}
return false;
}
Expand Down
17 changes: 0 additions & 17 deletions src/test/skript/environments/extra/paper-1.11.2.json

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "paper-1.10.2",
"name": "paper-1.15.2",
"resources": [
{"source": "server.properties.generic", "target": "server.properties"}
],
"paperDownloads": [
{
"version": "1.10.2",
"version": "1.15.2",
"target": "paperclip.jar"
}
],
Expand Down
17 changes: 0 additions & 17 deletions src/test/skript/environments/main/paper-1.12.2.json

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "paper-1.18.1",
"name": "paper-1.18.2",
"resources": [
{"source": "server.properties.generic", "target": "server.properties"}
],
"paperDownloads": [
{
"version": "1.18.1",
"version": "1.18.2",
"target": "paperclip.jar"
}
],
Expand Down
17 changes: 0 additions & 17 deletions src/test/skript/environments/main/paper-1.9.4.json

This file was deleted.

0 comments on commit 0c74e07

Please sign in to comment.