From 6bbf98d56966e04bc267fbd32c8cf1057362e041 Mon Sep 17 00:00:00 2001 From: "Paolo G. Giarrusso" Date: Sun, 29 Jul 2018 11:01:43 +0200 Subject: [PATCH 1/2] Reenable tests disabled/dropped in #4833 `lazyValsSepComp` was dropped in c9f1754ab1c9cb37af400eb71626dd9a8e975e73 without motivation. After readding it, `dotty-compiler-bootstrapped/testCompilation lazyValsSep` didn't find it; adding the forgotten `checkCompile` call fixed this as well. --- .../dotc/BootstrappedOnlyCompilationTests.scala | 2 +- docs/docs/contributing/testing.md | 9 ++++++++- tests/pos-with-compiler/lazyValsSepComp.scala | 16 ++++++++++++++++ 3 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 tests/pos-with-compiler/lazyValsSepComp.scala diff --git a/compiler/test/dotty/tools/dotc/BootstrappedOnlyCompilationTests.scala b/compiler/test/dotty/tools/dotc/BootstrappedOnlyCompilationTests.scala index 0eaf9368c159..d7f08cf20d8a 100644 --- a/compiler/test/dotty/tools/dotc/BootstrappedOnlyCompilationTests.scala +++ b/compiler/test/dotty/tools/dotc/BootstrappedOnlyCompilationTests.scala @@ -45,7 +45,7 @@ class BootstrappedOnlyCompilationTests extends ParallelTesting { compileDir("compiler/src/dotty/tools/dotc/util", defaultOptions) + compileDir("compiler/src/dotty/tools/io", defaultOptions) + compileDir("compiler/src/dotty/tools/dotc/core", TestFlags(classPath, noCheckOptions)) - } + }.checkCompile() @Test def posTwiceWithCompiler: Unit = { implicit val testGroup: TestGroup = TestGroup("posTwiceWithCompiler") diff --git a/docs/docs/contributing/testing.md b/docs/docs/contributing/testing.md index 95fbf9075249..5a33cd5ae169 100644 --- a/docs/docs/contributing/testing.md +++ b/docs/docs/contributing/testing.md @@ -58,7 +58,7 @@ You can also run all paths of classes of a certain name: These tests are Scala source files expected to compile with Dotty (pos tests), along with their expected output (run tests) or errors (neg tests). -All of these tests are contained in the `./tests/*` directories and can be run with the `testCompilation` command. +All of these tests are contained in the `./tests/*` directories and can be run with the `testCompilation` command. Tests in folders named `with-compiler` are an exception, see next section. Currently to run these tests you need to invoke from sbt: @@ -79,3 +79,10 @@ $ sbt This will run both the test `./tests/pos/companions.scala` and `./tests/neg/companions.scala` since both of these match the given string. This also means that you could run `testCompilation` with no arguments to run all integration tests. + +### Bootstrapped-only tests + +To run `testCompilation` on a bootstrapped Dotty compiler, use +`dotty-compiler-bootstrapped/testCompilation` (with the same syntax as above). +Some tests can only be run in bootstrapped compilers; that includes all tests +with `with-compiler` in their name. diff --git a/tests/pos-with-compiler/lazyValsSepComp.scala b/tests/pos-with-compiler/lazyValsSepComp.scala new file mode 100644 index 000000000000..a25da7131b6f --- /dev/null +++ b/tests/pos-with-compiler/lazyValsSepComp.scala @@ -0,0 +1,16 @@ +package dotty.tools +package io + +import java.io.{ InputStream } +import java.util.jar.JarEntry +import dotty.tools.dotc.core.Definitions +import language.postfixOps +import dotty.tools.dotc.core.Contexts._ + + + /** A test to trigger issue with separate compilation between Dotty and Scalac and lazy vals */ +object Foo { + val definitions: Definitions = null + def defn = definitions + def go = defn.FunctionClassPerRun +} From 7c9f85bbe87f4944c801becb6cfe36fc7e7f8b42 Mon Sep 17 00:00:00 2001 From: "Paolo G. Giarrusso" Date: Sun, 29 Jul 2018 18:25:48 +0200 Subject: [PATCH 2/2] Update comment --- tests/pos-with-compiler/lazyValsSepComp.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/pos-with-compiler/lazyValsSepComp.scala b/tests/pos-with-compiler/lazyValsSepComp.scala index a25da7131b6f..31f1619fcc25 100644 --- a/tests/pos-with-compiler/lazyValsSepComp.scala +++ b/tests/pos-with-compiler/lazyValsSepComp.scala @@ -8,7 +8,7 @@ import language.postfixOps import dotty.tools.dotc.core.Contexts._ - /** A test to trigger issue with separate compilation between Dotty and Scalac and lazy vals */ +/** A test to trigger issue with separate compilation and lazy vals */ object Foo { val definitions: Definitions = null def defn = definitions