Adding a pre-test check that looks for java files in the test/scala d… #857

Merged
merged 3 commits into from Apr 18, 2017
Jump to file or symbol
Failed to load files and symbols.
+24 −2
Split
View
@@ -81,6 +81,11 @@ tasks.withType(Test) { task ->
task.jvmArgs '-Djava.awt.headless=true' //this prevents awt from displaying a java icon while the tests are running
}
+task findScalaAndJavaTypes(type: Exec) {
+ description = "Check that Scala files only exist in the scala test dir and that java files do not reside in the scala test dir."
+ commandLine './scripts/checkScalaAndJavaFiles.sh'
+}
+
test {
description = "Runs the unit tests other than the SRA tests"
@@ -98,7 +103,7 @@ test {
if (System.env.CI == "false") exclude "sra"
if (!OperatingSystem.current().isUnix()) exclude "unix"
}
-}
+} dependsOn findScalaAndJavaTypes
task testSRA(type: Test) {
description = "Run the SRA tests"
@@ -0,0 +1,17 @@
+#/bin/bash
+
+# Check that Scala files only exist in the scala test dir and
+# that java files do not reside in the scala test dir
+
+if `find src | grep -v '^src/test/scala' | grep -q '\.scala$' ` ; then
+ echo 'Found scala file(s) outside of scala test directory';
+ find src | grep -v '^src/test/scala' | grep '\.scala$'
+ exit 1;
+fi
+
+if `find src/test/scala | grep -q '\.java$' ` ; then
+ echo 'Found java file(s) in scala test directory';
+ find src/test/scala | grep '\.java$'
+ exit 1;
+fi
+
@@ -106,7 +106,7 @@ class StringUtilTest extends UnitSpec {
StringUtil.assertCharactersNotInString("HelloWorld", ' ', '!', '_')
}
- val textForWrapping =
+ val textForWrapping: String =
"""This is a little bit
|of text with nice short
|lines.