summaryrefslogtreecommitdiff
path: root/src/partest
Commit message (Collapse)AuthorAgeFilesLines
* Add Bytecode test (ASM-based) to partest.Grzegorz Kossakowski2013-01-291-0/+61
| | | | | | | | | | | | | | | | | | | This commit introduces a new kind of test `Bytecode` that allows one to inspect bytecode generated for given piece of Scala code. The bytecode inspection is achieved by inspection of ASM trees. See the included example for details. NOTE: This commit does not introduce a new category of pratest tests. Bytecode tests should be run in `jvm` category of partest tests. Specific list of changes: * Add BytecodeTest that contains common utilities to partest * Add asm to classpath when compiling partest. That's not a new dependency as it's being already done for javac task we were running while compiling partest. * Add an example test that shows how to count null checks in given method.
* Merge pull request #1966 from paulp/pr/fix-java7-againPaul Phillips2013-01-243-3/+25
|\ | | | | Fix java7 again
| * Do not recompute stack frames when instrumenting bytecode.Grzegorz Kossakowski2013-01-242-25/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | It turns out that we do not need to do that. See comment in `ProfilerVisitor.java`. Also, since recomputing stack frame map was the only reason we needed to implement `getCommonSuperClass` we can now remove its implementation that was causing problems on Java 7 due to a cyclic dependency involving class loader because we would try to load a class we are currently transforming and transformer is triggered just before classloading. //cc @namin who worked on this code with me.
| * Set `canRetransform` flag to `false` in instrumentation.Grzegorz Kossakowski2013-01-241-1/+1
| | | | | | | | | | | | | | | | | | | | We do not need to retransform classes once they are loaded. All instrumentation byte-code is pushed at loading time. This fixes a problem with Java 7 that was failing to add a transformer because we did not declare retransformation capability in `MANIFEST.MF` file in Java agent jar. Java 6 allowed to add transformer due to a bug.
| * Correct whitespace in `ASMTransformer.java`.Grzegorz Kossakowski2013-01-241-27/+27
| | | | | | | | Let's stick to 2 spaces for indentation (and no tabs).
| * Fix class loader issues in instrumentation tests.Nada Amin2013-01-241-2/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | The ASM ClassWriter uses a wimpy class loader when computing common superclasses. This could cause a ClassNotFoundException in the transform method (at reader.accept). This exception gets swallowed, resulting in a class that should be instrumented to silently not be. The fix is to override getCommonSuperClass to use the correct class loader. Trivia: This bug was discovered while 'stress-testing' this instrumentation scheme on the Coursera students, to check that they implement one method in terms of another in the assignment.
* | Use the same default scalac options in all three partest frontendsSzabolcs Berecz2013-01-222-2/+2
|/ | | | | | | | | Make ConsoleRunner, AntRunner and SBTRunner take scalac options from "partest.scalac_opts" property. Also remove leftover "-deprecation" option from test/partest. The change to SBTRunner was not tested as sbt test is currently broken.
* Remove -deprecation from partest default options.Paul Phillips2012-12-272-2/+1
| | | | | | | Who knows why it was ever like this; it's not like anyone sees the deprecation warnings. In PR #1807 there is now a test which depends on partest not making this move, so it's a good time to finally expunge it.
* Merge pull request #1754 from retronym/ticket/6288Adriaan Moors2012-12-141-0/+4
|\ | | | | SI-6288 Perfecting positions
| * SI-6288 Fix positioning of label jumpsJason Zaugg2012-12-121-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ICode generation was assigning the position of the last label jump to all jumps to that particular label def. This problem is particularly annoying under the new pattern matcher: a breakpoint in the body of the final case will be triggered on the way out of the body of any other case. Thanks to @dragos for the expert guidance as we wended our way through GenICode to the troublesome code. Chalk up another bug for mutability. I believe that the ICode output should be stable enough to use a a .check file, if it proves otherwise we should make it so.
* | Merge pull request #1722 from vigdorchik/ide.apiAdriaan Moors2012-12-121-1/+1
|\ \ | |/ |/| Extract base scaladoc functionality for the IDE.
| * Extract base scaladoc functionality for the IDE.Eugene Vigdorchik2012-12-121-1/+1
| |
* | SI-6440 Address regressions around MissingRequirementErrorJason Zaugg2012-11-132-2/+21
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | Go back to using globalError to report when a stub's info is referenced, and only throw the MissingRequirementError when compilation really must abort due to having a StubTermSymbol in a place where a StubClassSymbol would have been a better choice. This situation arises when an entire package is missing from the classpath, as was the case in the reported bug. Adds `StoreReporterDirectTest`, which buffers messages issued during compilation for more structured interrogation. Use this in two test for manifests -- these tests were using a crude means of grepping compiler console output to focus on the relevant output, but this approach was insufficient with the new multi-line error message emitted as part of this change. Also used that base test class to add two new tests: one for the reported error (package missing), and another for a simpler error (class missing). The latter test shows how stub symbols allow code to compile if it doesn't the subset of signatures in some type that refer to a missing class. Gave the INFO/WARNING/ERROR members of Reporter sensible toString implementations; they inherit from Enumeration#Value in an unusual manner (why?) that means the built in toString of Enumeration printed `Severity@0`.
* Brings all copyrights (in comments) up-to-date, from 2011/12 to 2013Heather Miller2012-11-0229-29/+29
|
* Removing actors-migration from main repository so it can live on elsewhere.Josh Suereth2012-10-307-28/+3
| | | | | | | * Removes actors-migration hooks from partest * Removes actors-migration code * removes actors-migration tests * removes actors-migration distribution packaging.
* hardens DirectTest against missing -d settingsEugene Burmako2012-09-261-1/+1
| | | | | And also explicitly specifies -d in a test where I forgot to do that. Double checking never hurts.
* SI-6412 fixes leaks in Types.uniquesEugene Burmako2012-09-241-0/+38
| | | | | | | | This is the most blatant leak in reflection. There are others, but their impact is much smaller, therefore we'll fix them later, after 2.10.0-final. For more information, see https://issues.scala-lang.org/browse/SI-6412 and http://groups.google.com/group/scala-internals/browse_thread/thread/eabcf3d406dab8b2
* partest now always produces log files with LFsEugene Burmako2012-09-222-4/+23
|
* SI-6363 removes scala.reflect.baseEugene Burmako2012-09-191-2/+2
| | | | | As the experience has shown, there's no need for a separate layer of reflection in scala-library.jar. Therefore I'm putting an end to it.
* prepping for the refactoringEugene Burmako2012-09-191-6/+29
| | | | | | | | | | Reification (both tree-based and type-based) should be avoided before we release 2.10.0-final, since it impairs reflection refactorings like the upcoming one. Also the upcoming refactoring moves tag materialization anchors, and we have to add them to fast track in advance, so that they are treated as macros later.
* Merge pull request #1309 from paulp/210-no-relative-pathsPaul Phillips2012-09-161-3/+3
|\ | | | | More relative path elimination.
| * More relative path elimination.Paul Phillips2012-09-151-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some names I missed in 55b609458fd . How one might know when one is done: mkdir scratch && cd scratch mkdir annotation beans collection compat concurrent io \ math parallel ref reflect runtime scala sys testing \ text tools util xml scalac $(find ../src/library -name '*.scala') Until recently that would fail with about a billion errors. When it compiles, that's when you're done. And that's where this commit takes us, for src/library at least.
* | SI-6356 reflection now supports Java annotationsEugene Burmako2012-09-151-0/+1
|/ | | | | Except for one thingie: java enums are currently not understood by Scala reflection, hence they aren't yet supported in annotations.
* Eliminate breaking relative names in source.Paul Phillips2012-09-145-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These things are killing me. Constructions like package scala.foo.bar.baz import foo.Other DO NOT WORK in general. Such files are not really in the "scala" package, because it is not declared package scala package foo.bar.baz And there is a second problem: using a relative path name means compilation will fail in the presence of a directory of the same name, e.g. % mkdir reflect % scalac src/reflect/scala/reflect/internal/util/Position.scala src/reflect/scala/reflect/internal/util/Position.scala:9: error: object ClassTag is not a member of package reflect import reflect.ClassTag ^ src/reflect/scala/reflect/internal/util/Position.scala:10: error: object base is not a member of package reflect import reflect.base.Attachments ^ As a rule, do not use relative package paths unless you have explicitly imported the path to which you think you are relative. Better yet, don't use them at all. Unfortunately they mostly work because scala variously thinks everything scala.* is in the scala package and/or because you usually aren't bootstrapping and it falls through to an existing version of the class already on the classpath. Making the paths explicit is not a complete solution - in particular, we remain enormously vulnerable to any directory or package called "scala" which isn't ours - but it greatly limts the severity of the problem.
* "Hot fix" for broken build.Paul Phillips2012-09-141-1/+1
| | | | Two pull requests crossed in the night.
* Merge pull request #1271 from retronym/ticket/6331Josh Suereth2012-09-141-0/+27
|\ | | | | SI-6331 deconst If type / refine equality of floating point Constant types.
| * SI-6331 Avoid typing an If tree with a constant type.Jason Zaugg2012-09-081-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The fast path in typedIf added in 8552740b avoided lubbing the if/else branch types if they are identical, but this fails to deconst the type. This could lead to the entire if expression being replaced by a constant. Also introduces a new tool in partest for nicer checkfiles. // in Test.scala trace(if (t) -0d else 0d) // in Test.check trace> if (Test.this.t) -0.0 else 0.0 res: Double = -0.0
* | improve docs and Promise implRoland2012-09-111-1/+11
| | | | | | | | | | | | | | - scaladoc the exceptions thrown by Await.* and Awaitable.* - move intercept[Exception] into partest’s TestUtil object - improve Promise.tryAwait implementation following Viktor’s comments and make use of Deadline to avoid calling System.nanoTime too often
* | Sort files to see if we get reproducible testing results across linux/macJosh Suereth2012-09-051-2/+2
|/
* SBT build now works with SBT 0.12.Josh Suereth2012-08-311-3/+7
| | | | Also fixed partest explosion that happened after partest redesign.
* Support per-group flags files in partestphaller2012-08-091-1/+12
| | | | In a directory-based test with file A_1.scala, scalac flags that should apply only to A_1.scala can be put in the file A_1.flags. Local flags are appended to global flags.
* update and normalize copyright noticeAdriaan Moors2012-08-0720-20/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These are the regexp replacements performed: Sxcala -> Scala Copyright (\d*) LAMP/EPFL -> Copyright $1-2012 LAMP/EPFL Copyright (\d*)-(\d*)(,?) LAMP/EPFL -> Copyright $1-2012 LAMP/EPFL Copyright (\d*)-(\d*) Scala Solutions and LAMP/EPFL -> Copyright $1-2012 Scala Solutions and LAMP/EPFL \(C\) (\d*)-(\d*) LAMP/EPFL -> (C) $1-2012 LAMP/EPFL Copyright \(c\) (\d*)-(\d*)(.*?)EPFL -> Copyright (c) $1-2012$3EPFL The last one was needed for two HTML-ified copyright notices. Here's the summarized diff: Created using ``` git diff -w | grep ^- | sort | uniq | mate git diff -w | grep ^+ | sort | uniq | mate ``` ``` - <div id="footer">Scala programming documentation. Copyright (c) 2003-2011 <a href="http://www.epfl.ch" target="_top">EPFL</a>, with contributions from <a href="http://typesafe.com" target="_top">Typesafe</a>.</div> - copyright.string=Copyright 2002-2011, LAMP/EPFL - <meta name="Copyright" content="(C) 2002-2011 LAMP/EPFL"/> - * Copyright 2002-2011 LAMP/EPFL - * Copyright 2004-2011 LAMP/EPFL - * Copyright 2005 LAMP/EPFL - * Copyright 2005-2011 LAMP/EPFL - * Copyright 2006-2011 LAMP/EPFL - * Copyright 2007 LAMP/EPFL - * Copyright 2007-2011 LAMP/EPFL - * Copyright 2009-2011 Scala Solutions and LAMP/EPFL - * Copyright 2009-2011 Scxala Solutions and LAMP/EPFL - * Copyright 2010-2011 LAMP/EPFL - * Copyright 2012 LAMP/EPFL -# Copyright 2002-2011, LAMP/EPFL -* Copyright 2005-2011 LAMP/EPFL -/* NSC -- new Scala compiler -- Copyright 2007-2011 LAMP/EPFL */ -rem # Copyright 2002-2011, LAMP/EPFL ``` ``` + <div id="footer">Scala programming documentation. Copyright (c) 2003-2012 <a href="http://www.epfl.ch" target="_top">EPFL</a>, with contributions from <a href="http://typesafe.com" target="_top">Typesafe</a>.</div> + copyright.string=Copyright 2002-2012 LAMP/EPFL + <meta name="Copyright" content="(C) 2002-2012 LAMP/EPFL"/> + * Copyright 2002-2012 LAMP/EPFL + * Copyright 2004-2012 LAMP/EPFL + * Copyright 2005-2012 LAMP/EPFL + * Copyright 2006-2012 LAMP/EPFL + * Copyright 2007-2012 LAMP/EPFL + * Copyright 2009-2012 Scala Solutions and LAMP/EPFL + * Copyright 2010-2012 LAMP/EPFL + * Copyright 2011-2012 LAMP/EPFL +# Copyright 2002-2012 LAMP/EPFL +* Copyright 2005-2012 LAMP/EPFL +/* NSC -- new Scala compiler -- Copyright 2007-2012 LAMP/EPFL */ +rem # Copyright 2002-2012 LAMP/EPFL ```
* Merge pull request #996 from gkossakowski/instrumentation-fixesJosh Suereth2012-07-293-3/+15
|\ | | | | Partest instrumentation fixes
| * Fix `Instrumentation.getStatistics` method in partest.Grzegorz Kossakowski2012-07-262-2/+12
| | | | | | | | | | | | | | | | | | | | The previous implementation was wrong because it would always enable profiling after call to `Instrumenation.getStatistics` method. Now we are checking the profiling status and enable it again only when it was enabled before. Review by @phaller.
| * Instrument all classes in `instrumented` package.Grzegorz Kossakowski2012-07-261-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Extend instrumenting infrastructure to instrument classes in `instrumented` package. This is useful because very often you need to put your classes into non-empty package. E.g. inliner doesn't work properly with empty package at the moment so in order to test any behaviour we need to put classes in some other package that is instrumented. Added testing code for that to instrumentation test-case. Review by @phaller.
* | Fix a few scaladoc tests I broke.Paul Phillips2012-07-271-4/+2
| |
* | Eliminated all the current feature warnings.Paul Phillips2012-07-272-11/+16
| | | | | | | | This pretty much takes us down to deprecation and inliner warnings.
* | Eliminated remainder of "catches Throwable" warnings.Paul Phillips2012-07-273-5/+5
|/ | | | | | | | And also non-exhaustive matches. And added -nowarn to the build options for scalacheck, we don't need to hear the warnings for code we aren't able to fix.
* Merge pull request #924 from hubertp/2.10.x-issue/5385Adriaan Moors2012-07-201-2/+3
|\ | | | | Fix for SI-5385.
| * Fix for SI-5385.Paul Phillips2012-07-171-2/+3
| | | | | | | | | | Nodes which hit EOF with no whitespace afterward had wrong position.
* | Merge pull request #925 from VladUreche/issue/scaladocAdriaan Moors2012-07-201-4/+63
|\ \ | | | | | | Fix a bunch of scaladoc issues: SI-3314 SI-4888 SI-5235 SI-5558 SI-4324 SI-5780 SI-4887 SI-3695 SI-4224 SI-4497 SI-5079 SI-6073 SI-5533 SI-5784
| * | Scaladoc: GroupsVlad Ureche2012-07-191-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Group class members based on their semantic relationship. To do this: - @group on members, only need to do it for the non-overridden members - -groups flag passes to scaladoc, groups="on" in ant - @groupdesc Group Group Description to add descriptions - @groupname Group New name for group - @groupprio Group <int> (lower is better) See test/scaladoc/run/groups.scala for a top-to-bottom example
| * | SI-5784 Scaladoc: {Abstract,Alias} type templatesVlad Ureche2012-07-171-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Normally scaladoc won't generate template pages for anything other than packages, classes, traits and objects. But using the @template annotation on {abstract,alias} types, they get their own page and take part as full members in the diagrams. Furthermore, when looking for the companion object, if a value of type T is in scope, T will be taken as the companion object (even though it might be a class) All templates, including types are listed on the left navigation pane, so now adding @template to String can get scaladoc to generate (a no-comments) page for java.lang.String. The {abstract, alias} type icons need to be updated -- I just took the class icons and added a small x to them -- but they shoud be something else (maybe an underscore?)i TO USE THIS PATCH: <pre> /** @contentDiagram */ // tells scaladoc to create a diagram of the // templates contained in trait Base trait Base { /** @template */ // tells scaladoc to create a page for Foo type T < Foo trait Foo { def foo: Int } } /** @contentDiagram */ trait Api extends Base { /** @template */ override type T <: FooApi trait FooApi extends Foo { def bar: String } } </pre>
| * | Scaladoc: Refactoring the entitiesVlad Ureche2012-07-161-6/+6
| | | | | | | | | | | | | | | | | | | | | for SI-5784. This commit has been checked with tools/scaladoc-compare and the only difference is that the containing entities in the index are not duplicate anymore, which solves yet another bug we did not know about. :)
| * | SI-5533 Skip scaladoc packages from documentationVlad Ureche2012-07-161-1/+10
| | |
| * | SI-3695 SI-4224 SI-4497 SI-5079 scaladoc linksVlad Ureche2012-07-161-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | Adds the ability to link to members, classes and objects in scaladoc. The links can now be either qualified names or relative names, they both work. See the test/scaladoc/resources/links.scala for a usage example. Also introduced -no-link-warnings scaladoc flag, in case the build output gets swamped with link warnings.
| * | SI-3314 SI-4888 Scaladoc: Relative type prefixesVlad Ureche2012-07-161-4/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | And adds support for linking to class members, only usable from the model factory now, so no links to members from the doc comment yet, sorry. But it fixes the Enumeration problem once and for all! Also corrected the inTpl for members obtained by implicit conversions, so they're in the correct template and the comment variable expansion is done from the correct (but different) template. Review by @kzys.
| * | SI-5235 Correct usecase variable expansionVlad Ureche2012-07-161-0/+10
| |/ | | | | | | | | | | | | | | | | | | | | | | | | The bug is related to a couple of other annoyances, also fixed: - usecases without type params were crashing scaladoc due to a change in the PolyTypes class (not allowing empty tparams list) - properly getting rid of backticks (even if the link is not valid) - correct linking for usecases with $Coll = `immutable.Seq` (the symbol searching algorithm was too of restrictive, now we search the entire ownerchain - and the empty package at the end) - give a warning if the type lookup fails - finally, added a $Coll variable to List, for some reason it wasn't there and we were getting immutable.Seq as the result of use cases.
* | SI-5999 a real fix to the packageless problemEugene Burmako2012-07-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After a discussion on a reflection meeting on Jul 17 we concluded that we should split staticModule into staticModule and staticPackage to remove the ambiguity between packageless objects and packageless packages (more in the comments in the body of the commit). The motivation is verbosely outlined in the comments, but the bottom line is that Scala allows packages and packageless objects to have the same name within the same program. Therefore at times we need to disambiguate, hence the introduction of the staticPackage method. As of such staticModule no longer works for packages. In the same fashion staticPackage doesn't work for modules. This is done to ensure robustness of reification. I would like to do the same for getModule in Definitions, but we have to maintain backward compatibility. That's why I retained the old behavior, but replaced getModule invocations with getPackage where appropriate to be in line with staticModule and staticPackage. Another important thing that follows from the discussion is that both staticClass and staticModule prefer parent packages over parent objects in cases of ambiguity. Say, if we have the following snippet of code: object B { class C } next to package B { class C } then staticClass("B.C") will never even consider a C inside the object B. This is how scalac operates, so we decided to be consistent here. Finally reification logic got changed to distinguish between staticModule and staticPackage, and to allow for the fact that staticClass and staticModule prefer parent packages to parent objects.
* | Print the stack trace.Paul Phillips2012-07-191-1/+2
| | | | | | | | We're not completely blind in there, are we.