Tests fail, default RC path unknown?
I just tried to run the tests and they don't work on my machine. Do they work on yours?
I have a hypothesis of why they don't work. I ran into this issue here: https://github.com/tauri-apps/tauri/issues/2871#issuecomment-969191116 TLDR; registry access to blocked on my machine, winres cannot find my win sdk so defaults to an incorrect one.
I recognize that this is probably a one off error due to my computers strange configuration. However, I think we can make the issue more clear for new users by making the error message for these failing tests better. Here is what the tests look like on my machine:
> cargo test
Finished test [unoptimized + debuginfo] target(s) in 0.23s
Running unittests (target\debug\deps\winres-d3c7430050472df1.exe)
running 3 tests
test tests::toolkit_include_win10 ... ok
test tests::toolkit_include_win8 ... ok
test tests::string_escaping ... ok
test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
Doc-tests winres
running 6 tests
test lib.rs - WindowsResource::set_icon_with_id (line 357) ... ignored
test lib.rs - WindowsResource::set_icon_with_id (line 363) ... ignored
test lib.rs - WindowsResource::append_rc_content (line 540) ... FAILED
test lib.rs - WindowsResource::set_manifest (line 411) ... ok
test lib.rs - (line 12) ... ok
test lib.rs - WindowsResource::set_language (line 284) ... FAILED
failures:
---- lib.rs - WindowsResource::append_rc_content (line 540) stdout ----
Test executable failed (exit code 101).
stdout:
package.metadata does not exist
stderr:
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: NotPresent', lib.rs:638:64
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
---- lib.rs - WindowsResource::set_language (line 284) stdout ----
Test executable failed (exit code 101).
stdout:
package.metadata does not exist
stderr:
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: NotPresent', lib.rs:638:64
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
failures:
lib.rs - WindowsResource::append_rc_content (line 540)
lib.rs - WindowsResource::set_language (line 284)
test result: FAILED. 2 passed; 2 failed; 2 ignored; 0 measured; 0 filtered out; finished in 12.50s
error: test failed, to rerun pass '--doc'
Yes, that's definitely related to the registry access failure. At my workplace access to the registry is also disabled for normal users per group policy, that's why I submitted https://github.com/mxre/winres/pull/34
You can then specify the correct SDK with res.set_toolkit_path()
I don't think that this would be the right way for the doc test, though, since you'd have to pin the SDK version for the test then.