@@ -42,19 +42,43 @@ application {
42
42
mainClass = ' de.hhu.stups.codegenerator.CodeGenerator'
43
43
}
44
44
45
+ // The JavaScript tests currently cannot run in parallel,
46
+ // because multiple tests copy files to the same location and conflict with each other.
47
+ final noParallelTests = [
48
+ " de.hhu.stups.codegenerator.js.*" ,
49
+ ]
50
+
45
51
test {
46
- // We could enable executing tests in parallel, as recommended here:
52
+ // Execute tests in parallel where possible , as recommended here:
47
53
// https://docs.gradle.org/8.12/userguide/performance.html#execute_tests_in_parallel
48
- // But this currently doesn't work with the JavaScript tests,
49
- // because multiple tests copy files to the same location and conflict with each other.
50
- // maxParallelForks = Runtime.runtime.availableProcessors().intdiv(2) ?: 1
54
+ maxParallelForks = Runtime . runtime. availableProcessors(). intdiv(2 ) ?: 1
55
+
56
+ filter {
57
+ excludePatterns + = noParallelTests
58
+ }
59
+ }
60
+
61
+ final testNoParallel = tasks. register(" testNoParallel" , Test ) {
62
+ description = " Runs tests that cannot be executed in parallel."
63
+ group = " verification"
64
+
65
+ testClassesDirs = sourceSets. test. output. classesDirs
66
+ classpath = sourceSets. test. runtimeClasspath
51
67
68
+ filter {
69
+ includePatterns + = noParallelTests
70
+ }
71
+ }
72
+ tasks. named(" check" ). configure {
73
+ dependsOn + = [testNoParallel]
74
+ }
75
+
76
+ tasks. withType(Test ). configureEach {
52
77
testLogging {
53
78
events + = [TestLogEvent . PASSED ]
54
79
}
55
80
}
56
81
57
-
58
82
jar {
59
83
manifest {
60
84
attributes(
0 commit comments