aboutsummaryrefslogtreecommitdiff
path: root/bridge/src/sbt-test/source-dependencies/java-basic/test
diff options
context:
space:
mode:
authorGuillaume Martres <smarter@ubuntu.com>2016-05-31 15:23:04 +0200
committerFelix Mulder <felix.mulder@gmail.com>2016-06-07 17:10:36 +0200
commit09b2f39731386cd5b3688d5c3badf75d956d4f6d (patch)
treed122fc0e96d6c1cd22d7e0d0b5ee523563d534e7 /bridge/src/sbt-test/source-dependencies/java-basic/test
parent030ff82070197f0c126f5c0287e076b0f6b6dd8d (diff)
downloaddotty-09b2f39731386cd5b3688d5c3badf75d956d4f6d.tar.gz
dotty-09b2f39731386cd5b3688d5c3badf75d956d4f6d.tar.bz2
dotty-09b2f39731386cd5b3688d5c3badf75d956d4f6d.zip
Make the dotty-bridge sbt project a subproject of dotty
Note that the dotty-bridge tests will not be run automatically by `test` which is short for `dotty/test`, to run the dotty-bridge tests, do in sbt: > dotty-bridge/test > dotty-bridge/scripted Original history: https://github.com/smarter/dotty-bridge/commits/master
Diffstat (limited to 'bridge/src/sbt-test/source-dependencies/java-basic/test')
-rw-r--r--bridge/src/sbt-test/source-dependencies/java-basic/test45
1 files changed, 45 insertions, 0 deletions
diff --git a/bridge/src/sbt-test/source-dependencies/java-basic/test b/bridge/src/sbt-test/source-dependencies/java-basic/test
new file mode 100644
index 000000000..9dac40735
--- /dev/null
+++ b/bridge/src/sbt-test/source-dependencies/java-basic/test
@@ -0,0 +1,45 @@
+# Basic test for Java dependency tracking
+> 'eval System.setProperty("xsbt.inc.debug", "true")'
+
+# A is a basic Java file with no dependencies. Just a basic check for Java compilation
+$ copy-file changes/A.java src/main/java/a/A.java
+> compile
+
+# A2 is a basic Java file with no dependencies. This is added to verify
+# that classes are properly mapped back to their source.
+# (There are two files named A.java now, one in a/ and one in a/b)
+$ copy-file changes/A2.java src/main/java/a/b/A.java
+> compile
+
+# This adds B, another basic Java file with no dependencies
+$ copy-file changes/B1.java src/main/java/a/b/B.java
+> compile
+
+# Now, modify B so that it depends on a.A
+# This ensures that dependencies on a source not included in the compilation
+# (a/A.java has not changed) are tracked
+$ copy-file changes/B2.java src/main/java/a/b/B.java
+> compile
+
+# Remove a.b.A and there should be no problem compiling, since B should
+# have recorded a dependency on a.A and not a.b.A
+$ delete src/main/java/a/b/A.java
+> compile
+
+# Remove a.A and B should be recompiled if the dependency on a.A was properly
+# recorded. This should be a compile error, since we haven't updated B to not
+# depend on A
+$ delete src/main/java/a/A.java
+-> compile
+
+# Replace B with a new B that doesn't depend on a.A and so it should compile
+# It shouldn't run though, because it doesn't have a main method
+$ copy-file changes/B1.java src/main/java/a/b/B.java
+> compile
+-> run
+
+
+# Replace B with a new B that has a main method and should therefore run
+# if the main method was properly detected
+$ copy-file changes/B3.java src/main/java/a/b/B.java
+> run \ No newline at end of file