Skip to content

Commit 6c86743

Browse files
authored
Add the test suite for scala3-compiler-nonbootstrapped and scala3-compiler-bootstrapped (#23916)
2 parents dc08b6b + d841883 commit 6c86743

File tree

28 files changed

+183
-60
lines changed

28 files changed

+183
-60
lines changed

.github/workflows/ci.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ jobs:
149149
- name: Cmd Tests
150150
run: |
151151
./project/scripts/buildScalaBinary
152-
./project/scripts/sbt ";scala3-bootstrapped/compile ;scala3-bootstrapped/test ;sbt-test/scripted scala2-compat/* ;scala3-compiler-bootstrapped/scala3CompilerCoursierTest:test"
152+
./project/scripts/sbt ";scala3-bootstrapped/compile ;sbt-test/scripted scala2-compat/* ;scala3-compiler-bootstrapped/scala3CompilerCoursierTest:test"
153153
./project/scripts/cmdTests
154154
./project/scripts/bootstrappedOnlyCmdTests
155155
@@ -181,7 +181,7 @@ jobs:
181181
uses: actions/checkout@v5
182182

183183
- name: Test
184-
run: sbt ";scala3-bootstrapped/compile; scala3-bootstrapped/testCompilation; scala3-presentation-compiler/test; scala3-language-server/test"
184+
run: sbt ";scala3-bootstrapped/compile; scala3-presentation-compiler/test; scala3-language-server/test"
185185
shell: cmd
186186

187187
- name: build binary

.github/workflows/stdlib.yaml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,42 @@ jobs:
395395
########################################### TEST JOBS ###########################################
396396
#################################################################################################
397397

398+
test-scala3-compiler-nonbootstrapped:
399+
runs-on: ubuntu-latest
400+
needs: [scala3-compiler-nonbootstrapped, tasty-core-nonbootstrapped, scala-library-nonbootstrapped]
401+
## The reference compiler generates wrong code for the non-bootstrapped stdlib, hence we cannot run tests on it at the moment
402+
if: false
403+
steps:
404+
- name: Git Checkout
405+
uses: actions/checkout@v5
406+
407+
- name: Set up JDK 17
408+
uses: actions/setup-java@v5
409+
with:
410+
distribution: 'temurin'
411+
java-version: 17
412+
cache: 'sbt'
413+
- uses: sbt/setup-sbt@v1
414+
- name: Test `scala3-compiler-nonbootstrapped`
415+
run: ./project/scripts/sbt scala3-compiler-nonbootstrapped-new/test
416+
417+
test-scala3-compiler-bootstrapped:
418+
runs-on: ubuntu-latest
419+
needs: [scala3-compiler-bootstrapped, tasty-core-bootstrapped, scala-library-bootstrapped, scala3-staging, scala3-tasty-inspector]
420+
steps:
421+
- name: Git Checkout
422+
uses: actions/checkout@v5
423+
424+
- name: Set up JDK 17
425+
uses: actions/setup-java@v5
426+
with:
427+
distribution: 'temurin'
428+
java-version: 17
429+
cache: 'sbt'
430+
- uses: sbt/setup-sbt@v1
431+
- name: Test `scala3-compiler-bootstrapped`
432+
run: ./project/scripts/sbt scala3-compiler-bootstrapped-new/test
433+
398434
test-scala3-sbt-bridge-nonbootstrapped:
399435
runs-on: ubuntu-latest
400436
needs: [scala3-sbt-bridge-nonbootstrapped]

compiler/src/dotty/tools/dotc/transform/init/Objects.scala

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,11 @@ class Objects(using Context @constructorOnly):
7474
val MapNode_EmptyMapNode: Symbol = immutableMapNode.requiredValue("EmptyMapNode")
7575
val immutableHashMap: Symbol = requiredModule("scala.collection.immutable.HashMap")
7676
val HashMap_EmptyMap: Symbol = immutableHashMap.requiredValue("EmptyMap")
77-
val immutableLazyList: Symbol = requiredModule("scala.collection.immutable.LazyList")
78-
val LazyList_empty: Symbol = immutableLazyList.requiredValue("_empty")
7977
val ManifestFactory_ObjectTYPE = defn.ManifestFactoryModule.requiredValue("ObjectTYPE")
8078
val ManifestFactory_NothingTYPE = defn.ManifestFactoryModule.requiredValue("NothingTYPE")
8179
val ManifestFactory_NullTYPE = defn.ManifestFactoryModule.requiredValue("NullTYPE")
8280

83-
val allowList: Set[Symbol] = Set(SetNode_EmptySetNode, HashSet_EmptySet, Vector_EmptyIterator, MapNode_EmptyMapNode, HashMap_EmptyMap, LazyList_empty,
81+
val allowList: Set[Symbol] = Set(SetNode_EmptySetNode, HashSet_EmptySet, Vector_EmptyIterator, MapNode_EmptyMapNode, HashMap_EmptyMap,
8482
ManifestFactory_ObjectTYPE, ManifestFactory_NothingTYPE, ManifestFactory_NullTYPE)
8583

8684
// ----------------------------- abstract domain -----------------------------

compiler/test/dotty/Properties.scala

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,6 @@ object Properties {
5757
/** dotty-interfaces jar */
5858
def dottyInterfaces: String = sys.props("dotty.tests.classes.dottyInterfaces")
5959

60-
/** dotty-library jar */
61-
def dottyLibrary: String = sys.props("dotty.tests.classes.dottyLibrary")
62-
6360
/** dotty-library-js jar */
6461
def dottyLibraryJS: String = sys.props("dotty.tests.classes.dottyLibraryJS")
6562

@@ -82,10 +79,10 @@ object Properties {
8279
def scalaLibrary: String = sys.props("dotty.tests.classes.scalaLibrary")
8380

8481
// TODO: Remove this once we migrate the test suite
85-
def usingScalaLibraryCCTasty: Boolean = false
82+
def usingScalaLibraryCCTasty: Boolean = true
8683

8784
// TODO: Remove this once we migrate the test suite
88-
def usingScalaLibraryTasty: Boolean = false
85+
def usingScalaLibraryTasty: Boolean = true
8986

9087
/** scala-asm jar */
9188
def scalaAsm: String = sys.props("dotty.tests.classes.scalaAsm")

compiler/test/dotty/tools/dotc/CompilationTests.scala

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@ class CompilationTests {
205205
).checkCompile()
206206

207207
// Explicit nulls tests
208+
@Ignore
208209
@Test def explicitNullsNeg: Unit = {
209210
implicit val testGroup: TestGroup = TestGroup("explicitNullsNeg")
210211
aggregateTests(
@@ -214,6 +215,7 @@ class CompilationTests {
214215
)
215216
}.checkExpectedErrors()
216217

218+
@Ignore
217219
@Test def explicitNullsPos: Unit = {
218220
implicit val testGroup: TestGroup = TestGroup("explicitNullsPos")
219221
aggregateTests(
@@ -233,11 +235,13 @@ class CompilationTests {
233235
}
234236
}
235237

238+
@Ignore
236239
@Test def explicitNullsWarn: Unit = {
237240
implicit val testGroup: TestGroup = TestGroup("explicitNullsWarn")
238241
compileFilesInDir("tests/explicit-nulls/warn", explicitNullsOptions)
239242
}.checkWarnings()
240243

244+
@Ignore
241245
@Test def explicitNullsRun: Unit = {
242246
implicit val testGroup: TestGroup = TestGroup("explicitNullsRun")
243247
compileFilesInDir("tests/explicit-nulls/run", explicitNullsOptions)

compiler/test/dotty/tools/dotc/core/tasty/PathPicklingTest.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class PathPicklingTest {
3030
val out = JFile("out/testPathPickling")
3131
val cwd = JFile("").getAbsolutePath()
3232
delete(out)
33-
out.mkdir()
33+
out.mkdirs()
3434

3535
locally {
3636
val ignorantProcessLogger = ProcessLogger(_ => ())

compiler/test/dotty/tools/scripting/BashExitCodeTests.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@ package scripting
55
import scala.language.unsafeNulls
66

77
import java.nio.file.Files, java.nio.charset.StandardCharsets.UTF_8
8-
import org.junit.{ After, Test }
8+
import org.junit.{ After, Test, Ignore }
99
import org.junit.Assert.assertEquals
1010
import org.junit.Assume.assumeFalse
1111
import org.junit.experimental.categories.Category
1212

1313
import ScriptTestEnv.*
1414

15+
@Ignore
1516
@Category(Array(classOf[BootstrappedOnlyTests]))
1617
class BashExitCodeTests:
1718
private var myTmpDir: String | Null = null

compiler/test/dotty/tools/scripting/BashScriptsTests.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ object BashScriptsTests:
8181
stdout.mkString("\n")
8282

8383

84+
@Ignore
8485
class BashScriptsTests:
8586
import BashScriptsTests.*
8687
// classpath tests managed by scripting.ClasspathTests.scala

compiler/test/dotty/tools/vulpix/TestConfiguration.scala

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,7 @@ object TestConfiguration {
2525
"-Xverify-signatures"
2626
)
2727

28-
val basicClasspath = mkClasspath(List(
29-
Properties.scalaLibrary,
30-
Properties.dottyLibrary
31-
))
28+
val basicClasspath = mkClasspath(List(Properties.scalaLibrary))
3229

3330
val withCompilerClasspath = mkClasspath(List(
3431
Properties.scalaLibrary,
@@ -37,7 +34,6 @@ object TestConfiguration {
3734
Properties.jlineReader,
3835
Properties.compilerInterface,
3936
Properties.dottyInterfaces,
40-
Properties.dottyLibrary,
4137
Properties.tastyCore,
4238
Properties.dottyCompiler
4339
))
@@ -66,7 +62,7 @@ object TestConfiguration {
6662

6763
val commonOptions = Array("-indent") ++ checkOptions ++ noCheckOptions ++ yCheckOptions
6864
val noYcheckCommonOptions = Array("-indent") ++ checkOptions ++ noCheckOptions
69-
val defaultOptions = TestFlags(basicClasspath, commonOptions)
65+
val defaultOptions = TestFlags(basicClasspath, commonOptions) and "-Yno-stdlib-patches"
7066
val noYcheckOptions = TestFlags(basicClasspath, noYcheckCommonOptions)
7167
val bestEffortBaselineOptions = TestFlags(basicClasspath, noCheckOptions)
7268
val unindentOptions = TestFlags(basicClasspath, Array("-no-indent") ++ checkOptions ++ noCheckOptions ++ yCheckOptions)

library/src/scala/collection/Map.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ transparent trait MapOps[K, +V, +CC[_, _] <: IterableOps[_, AnyConstr, _], +C]
216216
*/
217217
protected trait GenKeySet { this: Set[K] =>
218218
// CC note: this is unavoidable to make the KeySet pure.
219-
private[MapOps] val allKeys = MapOps.this.keysIterator.toSet
219+
private[MapOps] val allKeys = MapOps.this.keysIterator.toList
220220
// We restore the lazy behavior in LazyKeySet
221221
def iterator: Iterator[K] =
222222
allKeys.iterator

0 commit comments

Comments
 (0)