Skip to content

Add the ability to get the current script or project path when using the new test runner #110

Open
@alextekartik

Description

@alextekartik

http://stackoverflow.com/questions/30214563/get-current-script-path-or-current-project-path-using-new-test-runner
I am porting old vm unittest files using the new test package. Some relies on input files in sub directories of my test folder. Before I was using Platform.script to find the location of such files. This works fine when using

$ dart test/my_test.dart

However using

$ pub run test

this is now pointing to a temp folder (tmp/dart_test_xxxx/runInIsolate.dart). I am unable to locate my test input files anymore. I cannot rely on the current path as I might run the test from a different working directory.

Is there a way to find the location of my_test.dart (or event the project root path), from which I could derive the locations of my files?

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-enhancementA request for a change that isn't a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions