Comments (3)
I've found out why. In BaseRunner.scala#L61, getClassName
returns <jscode>
for every stack trace frame.
I also tried and failed with these:
.getClass.getName
- returnsjava.lang.StackTraceElement
for every frame..getClass.getSimpleName
- returnsStackTraceElement
for every frame..getClass.getCanonicalName
- not implemented in SJS..getClass.getTypeName
- not implemented in SJS..getClass.getPackage.getName
- not implemented in SJS.
from utest.
.getClassName
is the right thing. It has nothing to do with getClass.getName
. See StackTraceElement
However getClassName
is quite unreliable. We basically try to recover this information from the VM's stack trace, which is a string with a format varying from VM to VM, and from version to version ^^. The recovery heuristics are in StackTrace. Sometimes the VM's stack trace doesn't even contain the class name, in which case there's nothing we can do.
getMethodName
is pretty reliable. getFileName
as well, but doesn't apply source maps in all VMs, such as PhantomJS.
The most reliable way to cut such a stack trace is to have a method with a pretty unique and recognizable name, which you can identify with getMethodName
.
from utest.
This should be fixed in master by 2810c62#diff-910ec1813f88878eb7ec68c377062fb0 and the follow up f38bd2b#diff-910ec1813f88878eb7ec68c377062fb0, which uses getClassName
and getMethodName
to decide on stack trace cutoff, and @noinline
to try and make sure Scala.js doesn't make the marker methods disappear
from utest.
Related Issues (20)
- publish for scala 2.13.0-RC2
- default timeout for tests returning Future
- [Feature Request] Dynamicly generate test by macros.
- Cannot resolve symbol test HOT 1
- Git tag for uTest 0.7.0, 0.7.1 is missing HOT 1
- New release targetting Scala Native 0.4.0-M2 HOT 1
- Port to Scala 2.11 - part b HOT 1
- stale code references to TestTreeSeq
- update readme.md to reflect supported scala versions
- Output like pytest
- 0.27.0-RC1 artifacts require Java 11 HOT 12
- ClassCastException under Scala 3 HOT 1
- Compiler warning when using TestPath implicits as shown in Doc HOT 2
- Tests macro generates invalid code with Scala 3 and Scala.js HOT 1
- Missing test run?
- disabled test (feature request)
- Release utest for Scala Native v0.4.1 HOT 1
- exception during macro expansion: java.lang.ArrayIndexOutOfBoundsException: HOT 2
- "[error] Error during tests" on Scala Native HOT 1
- Loss of location of assert when using smart asserts. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from utest.