mirror of
https://github.com/Cheviiot/Vintner.git
synced 2026-08-03 15:57:24 +00:00
IsMtExe() looked for the last '\\' in the target executable path to find the bare filename, but vintner passes toolExePath straight from Go's filepath.Join (forward slashes) all the way through to CreateProcessW - so the path toolrelay.exe actually receives has no backslash in it at all, and IsMtExe() compared the *entire path* against "mt.exe", which of course never matched. The whole point of this file - translating mt.exe's CMake-compatibility exit code (0x41020001 -> 0xbb) before Wine's own exit-code truncation destroys it - has silently never fired in real usage. This had gone unnoticed because MSBuild's rawStdout path bypasses toolrelay.exe entirely, and every real end-to-end test so far (msbuild-driven builds, including the KMDF driver) went through that path. Found while getting a CMake+Ninja-generated MSVC build of a real project (Ogre3D) past its `cmake -E vs_link_exe` manifest step, which depends on exactly this translation. Now checks for both '\\' and '/' and uses whichever separator occurs last in the path. Verified directly: `mt /manifest ... /notify_update` through the wrapper now exits 187 (0xbb) instead of 1, and the Ogre build gets past the manifest-embedding step it was failing at.
46 lines
934 B
Go
46 lines
934 B
Go
package wrapper
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/Cheviiot/vintner/internal/wineenv"
|
|
)
|
|
|
|
func TestSpecExeDir(t *testing.T) {
|
|
paths := &wineenv.Paths{
|
|
BinDir: "/bin-dir",
|
|
SDKBinDir: "/sdk-bin-dir",
|
|
MSBuildBinDir: "/msbuild-bin-dir",
|
|
}
|
|
for _, tc := range []struct {
|
|
name string
|
|
dir dirKind
|
|
want string
|
|
}{
|
|
{"dirBin", dirBin, "/bin-dir"},
|
|
{"dirSDK", dirSDK, "/sdk-bin-dir"},
|
|
{"dirMSBuild", dirMSBuild, "/msbuild-bin-dir"},
|
|
} {
|
|
s := spec{dir: tc.dir}
|
|
if got := s.exeDir(paths); got != tc.want {
|
|
t.Errorf("%s: exeDir() = %q, want %q", tc.name, got, tc.want)
|
|
}
|
|
}
|
|
}
|
|
|
|
func TestToolsAndNativeToolsAreDisjoint(t *testing.T) {
|
|
for name := range Tools {
|
|
if nativeTools[name] {
|
|
t.Errorf("%q is in both Tools and nativeTools", name)
|
|
}
|
|
}
|
|
}
|
|
|
|
func TestEveryToolHasAnExeName(t *testing.T) {
|
|
for name, s := range Tools {
|
|
if s.exeName == "" {
|
|
t.Errorf("Tools[%q] has no exeName", name)
|
|
}
|
|
}
|
|
}
|