diff options
author | Iulian Dragos <jaguarul@gmail.com> | 2011-03-07 18:04:01 +0000 |
---|---|---|
committer | Iulian Dragos <jaguarul@gmail.com> | 2011-03-07 18:04:01 +0000 |
commit | cb0d585411b0c7336591b4d129b99be2946ba203 (patch) | |
tree | 4d60b8ab0e25e5dfcc34495374bfc4ed518e466a | |
parent | 7e2259fc9412c429ba80fed07d5a3839c8f1e2c1 (diff) | |
download | scala-cb0d585411b0c7336591b4d129b99be2946ba203.tar.gz scala-cb0d585411b0c7336591b4d129b99be2946ba203.tar.bz2 scala-cb0d585411b0c7336591b4d129b99be2946ba203.zip |
Made the .opts file in presentation compiler te...
Made the .opts file in presentation compiler tests be 'platform
independent'. Paths are given in Unix notation. no review.
-rw-r--r-- | src/compiler/scala/tools/nsc/interactive/tests/InteractiveTest.scala | 19 | ||||
-rw-r--r-- | test/files/presentation/simple-tests.opts | 3 |
2 files changed, 21 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/interactive/tests/InteractiveTest.scala b/src/compiler/scala/tools/nsc/interactive/tests/InteractiveTest.scala index a00fd44ed3..2ff3223ed9 100644 --- a/src/compiler/scala/tools/nsc/interactive/tests/InteractiveTest.scala +++ b/src/compiler/scala/tools/nsc/interactive/tests/InteractiveTest.scala @@ -58,7 +58,25 @@ abstract class InteractiveTest { str.lines.filter(!_.startsWith("#")).mkString(" ") } + /** Prepare the settings object. Load the .opts file and adjust all paths from the + * Unix-like syntax to the platform specific syntax. This is necessary so that a + * single .opts file can be used on all platforms. + * + * @note Bootclasspath is treated specially. If there is a -bootclasspath option in + * the file, the 'usejavacp' setting is set to false. This ensures that the + * bootclasspath takes precedence over the scala-library used to run the current + * test. + */ def prepareSettings() { + import java.io.File._ + def adjustPaths(paths: settings.PathSetting*) { + for (p <- paths) p.value = p.value.map { + case '/' => separatorChar + case ':' => pathSeparatorChar + case c => c + } + } + // need this so that the classpath comes from what partest // instead of scala.home settings.usejavacp.value = !argsString.contains("-bootclasspath") @@ -69,6 +87,7 @@ abstract class InteractiveTest { println("error processing arguments (unprocessed: %s)".format(rest)) case _ => () } + adjustPaths(settings.bootclasspath, settings.classpath, settings.javabootclasspath, settings.sourcepath) } protected def printClassPath { diff --git a/test/files/presentation/simple-tests.opts b/test/files/presentation/simple-tests.opts index 226b40a9f5..8529bbf1a0 100644 --- a/test/files/presentation/simple-tests.opts +++ b/test/files/presentation/simple-tests.opts @@ -10,7 +10,8 @@ # the classpath is relative to the current working directory. That means it depends where you're # running partest from. Run it from the root scala checkout for these files to resolve correctly -# (by default when running 'ant test', or 'test/partest'). +# (by default when running 'ant test', or 'test/partest'). Paths use Unix separators, the test +# framework translates them to the platform dependent representation. -bootclasspath lib/scala-compiler.jar:lib/scala-library.jar:lib/fjbg.jar # the following line would test using the quick compiler |