Open jakemac53 opened 2 months ago
@matanlurey would you be able to put together a prototype of your intended usage so we can confirm whether this solves the problem?
This is only meant to solve the original problem stated in https://github.com/dart-lang/test/issues/110, which is getting the path to the test script. It does not help with getting access to the package root, but Uri.base
does already give you that (whenever using the test runner).
but
Uri.base
does already give you that
Does this get impacted by changes to the working directory?
Does this get impacted by changes to the working directory?
Probably, although I don't know for sure. But, that is partially why I like just exposing the relative suite path. We can be out of the business of the rest of it, which isn't really in our control. We can provide suggestions with caveats (like using Uri.base), which will work for most, but we don't guarantee them or support them directly.
Possible resolution to https://github.com/dart-lang/test/issues/110.
Adds a
suitePath
getter which gives the package relative path to the current suite if it is available.Uri.base
already actually contains the full path including the suite, so you don't want to use this there which is a bit weird. On the VM you want to do something likeUri.base.resolve(suitePath).resolve(<some-suite-relative-path>)
.<base>
tag to the html page, setting it to be the package root.I also expanded the test coverage in
test_api
to VM/chrome and all compilers, just to ensure this works everywhere.