summaryrefslogtreecommitdiff
path: root/test/files/disabled
diff options
context:
space:
mode:
authorJames Iry <jamesiry@gmail.com>2013-01-27 10:16:15 -0800
committerJames Iry <jamesiry@gmail.com>2013-01-27 10:16:15 -0800
commit3cbb0029e98304c7bd86b4854086d67f0e06b6b4 (patch)
treefc2bbf520bb20898d526d61e1c18c828858110bc /test/files/disabled
parent952e1bfe02cd12b7882aae97ee0901094c7a38c7 (diff)
downloadscala-3cbb0029e98304c7bd86b4854086d67f0e06b6b4.tar.gz
scala-3cbb0029e98304c7bd86b4854086d67f0e06b6b4.tar.bz2
scala-3cbb0029e98304c7bd86b4854086d67f0e06b6b4.zip
SI-4602 Disable unreliable test of fsc path absolutization
The included test for fsc path absolutization almost certainly has the same reliability problem as a similar test that was disabled in https://github.com/scala/scala/pull/1985 . Disabling the test until I can figure out a reliable way to test fsc in an our continuous integration environment.
Diffstat (limited to 'test/files/disabled')
-rw-r--r--test/files/disabled/run/t4602.scala57
1 files changed, 57 insertions, 0 deletions
diff --git a/test/files/disabled/run/t4602.scala b/test/files/disabled/run/t4602.scala
new file mode 100644
index 0000000000..73ba231ccf
--- /dev/null
+++ b/test/files/disabled/run/t4602.scala
@@ -0,0 +1,57 @@
+import java.io.{File, FileOutputStream, BufferedOutputStream, FileWriter, ByteArrayOutputStream, PrintStream}
+import tools.nsc.{CompileClient, CompileServer}
+import java.util.concurrent.{CountDownLatch, TimeUnit}
+
+object Test extends App {
+ val startupLatch = new CountDownLatch(1)
+ // we have to explicitly launch our server because when the client launches a server it uses
+ // the "scala" shell command meaning whatever version of scala (and whatever version of libraries)
+ // happens to be in the path gets used
+ val t = new Thread(new Runnable {
+ def run() = {
+ CompileServer.execute(() => startupLatch.countDown(), Array[String]())
+ }
+ })
+ t setDaemon true
+ t.start()
+ if (!startupLatch.await(2, TimeUnit.MINUTES))
+ sys error "Timeout waiting for server to start"
+
+ val baos = new ByteArrayOutputStream()
+ val ps = new PrintStream(baos)
+
+ val outdir = scala.reflect.io.Directory(sys.props("partest.output"))
+
+ val dirNameAndPath = (1 to 2).toList map {number =>
+ val name = s"Hello${number}"
+ val dir = outdir / number.toString
+ (dir, name, dir / s"${name}.scala")
+ }
+
+ dirNameAndPath foreach {case (dir, name, path) =>
+ dir.createDirectory()
+ val file = path.jfile
+ val out = new FileWriter(file)
+ try
+ out.write(s"object ${name}\n")
+ finally
+ out.close
+ }
+
+ val success = (scala.Console withOut ps) {
+ dirNameAndPath foreach {case (path, name, _) =>
+ CompileClient.process(Array("-verbose", "-current-dir", path.toString, s"${name}.scala"))
+ }
+
+ CompileClient.process(Array("-shutdown"))
+ }
+
+ // now make sure we got success and the correct normalized paths
+ val msg = baos.toString()
+
+ assert(success, s"got a failure. Full results were: \n${msg}")
+ dirNameAndPath foreach {case (_, _, path) =>
+ val expected = s"Input files after normalizing paths: ${path}"
+ assert(msg contains expected, s"could not find '${expected}' in output. Full results were: \n${msg}")
+ }
+}