Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

subclass of scala.tools.partest.DirectTest to compare javap for output classfiles #5985

Closed
scabug opened this issue Jun 26, 2012 · 6 comments
Assignees
Milestone

Comments

@scabug
Copy link

scabug commented Jun 26, 2012

There is no subclass of scala.tools.partest.DirectTest to compare javap for output classfiles (as generated by -Ygen-javap).

That's necessary to test, for example, whether certain JVM attributes are being emitted (motivation: #5983)

In case javap is not available on the machine running partest, ASM's scala.tools.asm.util.Textifier could be used instead (via GenASM).

@scabug
Copy link
Author

scabug commented Jun 26, 2012

Imported From: https://issues.scala-lang.org/browse/SI-5985?orig=1
Reporter: @magarciaEPFL
See #6894

@scabug
Copy link
Author

scabug commented Jun 27, 2012

@scabug
Copy link
Author

scabug commented Jun 29, 2012

@magarciaEPFL said:
As discussed at scala-internals/OhGZeyBAGig , verbatim comparison of javap output is inflexible.

That can be addressed in a manner similar to scala.tools.partest.CompilerTest :

  • emit classfiles as usual
  • have a DirectTest subclass parse each classfile using ASM's Tree API
  • have an "acceptor" class provided as part of the test that inspects the trees parsed above.
    The ASM Tree API does not support a "bytecode query language" nor a DSL to that effect, but still drilling into details of interest should be easier to maintain than verbatim javap output.

@scabug
Copy link
Author

scabug commented Jul 2, 2012

@adriaanm said:
Assigning to you, Miguel, since you seem to be working on it.

@scabug
Copy link
Author

scabug commented Jan 7, 2013

@som-snytt said:
#6894 includes simple JavapTest for asserts about textual output, using the repl facility. Crude for when crudity suffices.

@scabug
Copy link
Author

scabug commented Feb 8, 2013

@retronym said:
I'd say that '8610d7ec' covers the requirements here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants