akavel / rsrc

Tool for embedding .ico & manifest resources in Go programs for Windows.
MIT License
1.22k stars 122 forks source link

Add tests #13

Open akavel opened 8 years ago

akavel commented 8 years ago

I think there are some Windows APIs for reading resources from an .exe file on disk. Those could be used to verify that we've built a .syso that results in a correct .exe, with all information in right places. In such case the tests could look like this:

  1. TestExeLinks — this would:
    • run rsrc -ico ... -manifest ... to create a test.syso file
    • run go build dummy.go test.syso and verify it exits successfully, and that an .exe file was created;
  2. TestExeRuns — this would execute same code as TestExeLinks, but then would check that the .exe runs successfully and produces some "Hello-world"-like output on stdout.
  3. TestIco — this would execute TestExeLinks and then try to open it with Windows resources API and check if it contains an icon, and some basic info about this icon.
  4. TestManifest — similar like TestIco, but would verify manifest, and ideally its contents too.