veandco / go-sdl2

SDL2 binding for Go
https://godoc.org/github.com/veandco/go-sdl2
BSD 3-Clause "New" or "Revised" License
2.2k stars 218 forks source link

Do in tests #388

Closed gonutz closed 5 years ago

gonutz commented 5 years ago

Hey, I am trying to use your tests for my DLL port but right away when I copy TestEventsAddEventWatch I get a panic in the test because the test does not call Main but uses Do. Could you explain to me how you run your tests if not with go test? Is it a different way of running the tests? Do they even pass (I have currently no C-compiler on my Windows so I have not run your tests but I assume they all pass)?

veeableful commented 5 years ago

Hi @gonutz, I use go test to run the tests. However there is TestMain() in sdl_test.go that will be called first which will in turn call the sdl.Main() function. But yeeeah, the tests are not super comprehensive or looked after right now. I just fixed a compile error and the tests seem to pass (for now!).

gonutz commented 5 years ago

I see, that is what I was missing. Thank you very much, I am on my way and testing now. I want to have as many functions tested as possible and I am using your repo as an example. The progress of my port is good, only a handful of functions that have not yet been ported. After testing as much as possible I will probably open the PR.