Skip to content

Conversation

@adkian-sifive
Copy link
Contributor

Move spec files from src/test/scala-2 to src/test/scala/ and update for cross-compilation with Scala 3.

Contributor Checklist

  • Did you add Scaladoc to every public function/method?
  • Did you add at least one test demonstrating the PR?
  • Did you delete any extraneous printlns/debugging code?
  • Did you specify the type of improvement?
  • Did you add appropriate documentation in docs/src?
  • Did you request a desired merge strategy?
  • Did you add text to be included in the Release Notes for this change?

Type of Improvement

  • Feature (or new API)
  • API modification
  • API deprecation
  • Backend code generation
  • Performance improvement
  • Bugfix
  • Documentation or website-related
  • Dependency update
  • Internal or build-related (includes code refactoring/cleanup)

Desired Merge Strategy

  • Squash: The PR will be squashed and merged (choose this if you have no preference).
  • Rebase: You will rebase the PR onto master and it will be merged with a merge commit.

Release Notes

Reviewer Checklist (only modified by reviewer)

  • Did you add the appropriate labels? (Select the most appropriate one based on the "Type of Improvement")
  • Did you mark the proper milestone (Bug fix: 3.6.x, 5.x, or 6.x depending on impact, API modification or big change: 7.0)?
  • Did you review?
  • Did you check whether all relevant Contributor checkboxes have been checked?
  • Did you do one of the following when ready to merge:
    • Squash: You/ the contributor Enable auto-merge (squash) and clean up the commit message.
    • Merge: Ensure that contributor has cleaned up their commit history, then merge with Create a merge commit.

@adkian-sifive adkian-sifive force-pushed the adkian-sifive/scala3-testing-I branch 2 times, most recently from fa56dfd to 2e3d722 Compare November 25, 2025 00:32
@adkian-sifive adkian-sifive added the Scala 3 Changes related to upgrading to Scala 3 label Nov 25, 2025
Copy link
Member

@seldridge seldridge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally LGTM. Some nits and there are some issues with CI.

import org.scalatest.funspec.AnyFunSpec
import org.scalatest.matchers.must.Matchers
import org.scalatest.matchers.should.Matchers.convertToAnyShouldWrapper
// import org.scalatest.matchers.should.Matchers.convertToStringShouldWrapperForVerb
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: please don't commit commented out code.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah this is a tricky one. the scalatest API is subtly different between Scala 2 and 3 leading to an either-or situation as to which ShouldWrapper to use. will revisit and fix

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check that ScalaTest doesn't already have a way to deal with this--it would be pretty bush league for such a popular library to screw this up. If they dont then we can polyfill it ourselves by adding a type alias for one or the other in the version-specific sources (e.g. in src/main/scala-2 define org.scalatest.matchers.should.Matchers.convertToStringShouldWrapperForVerb as a type alias for org.scalatest.matchers.should.Matchers.convertToAnyShouldWrapper).

val in = IO(Input(UInt(8.W)))
val fd = SimLog.file("logfile.log")
fd.printf("in = %d\n", in)
// fd.printf("in = %d\n", in)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this shouldn't be commented out?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm surprised this file has so many lines added. Can you clarify what is going on?

@adkian-sifive adkian-sifive force-pushed the adkian-sifive/scala3-testing-I branch 2 times, most recently from 02921bb to a482a98 Compare November 25, 2025 21:40
@adkian-sifive adkian-sifive force-pushed the adkian-sifive/scala3-testing-I branch from a482a98 to 85ad8fa Compare November 25, 2025 22:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scala 3 Changes related to upgrading to Scala 3

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants