17: Respect user provided absolute path r=matklad a=mvtec-bergdolll
When the environment variable CARGO_MANIFEST_DIR is not present as is the default when opening a workspace project in vs code and running the tests. `expect-test` panics.
The problem can be reproduced with this minimal project https://github.com/mvtec-bergdolll/expect-test-repro-proj/tree/main. Open it in vs code and run the integration tests. They panic. However running them from the shell does not panic. That's unfortunate.
As user trying to debug this I was confused why it failed even when providing an absolute path.
This change includes:
- Do not query CARGO_MANIFEST_DIR if the user already provided an absolute path when calculating an absolute path
- Better error message when CARGO_MANIFEST_DIR is not present
I'm not sure how to easily test this so I've not added automated testing.
Co-authored-by: Lukas Bergdoll <lukas.bergdoll@mvtec.com>