Skip to content

Commit

Permalink
Attempts to fix the windows releases (#128)
Browse files Browse the repository at this point in the history
* Add core testdata that will work on windows
* Try copying the libwinpthread-1.dll in the bundle
  • Loading branch information
kivutar authored Jan 31, 2019
1 parent 7992056 commit 522fd7c
Show file tree
Hide file tree
Showing 11 changed files with 30 additions and 28 deletions.
6 changes: 4 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,17 +80,19 @@ matrix:
- 7z x openal-soft-1.19.0-bin.zip -o/c/Users/travis/openal-soft-1.19.0-bin
- export CGO_CFLAGS="-I/c/Users/travis/openal-soft-1.19.0-bin/include/"
- export CGO_LDFLAGS="-L/c/Users/travis/openal-soft-1.19.0-bin/build/Release/"
- cp /c/ProgramData/chocolatey/lib/mingw/tools/install/mingw64/x86_64-w64-mingw32/lib/libwinpthread* .
- cp /c/Users/travis/openal-soft-1.19.0-bin/build/Release/OpenAL32.* .
script:
- go get -v ./...
#- go test -v -race ./...
#- go test -v ./...
#- go vet ./...
- megacheck ./...
- gocyclo -over 19 $GO_FILES
- golint -set_exit_status $(go list ./...)
- go build -v
before_deploy:
- if [[ -n "$TRAVIS_TAG" ]]; then mkdir -p ./Ludo-Windows-x86_64-${TRAVIS_TAG:1}/; fi
- if [[ -n "$TRAVIS_TAG" ]]; then cp /c/Users/travis/openal-soft-1.19.0-bin/build/Release/OpenAL32.dll ./Ludo-Windows-x86_64-${TRAVIS_TAG:1}/; fi
- if [[ -n "$TRAVIS_TAG" ]]; then cp *.dll ./Ludo-Windows-x86_64-${TRAVIS_TAG:1}/; fi
- if [[ -n "$TRAVIS_TAG" ]]; then OS="Windows" ARCH=x86_64 VERSION=${TRAVIS_TAG:1} make zip; fi

deploy:
Expand Down
52 changes: 26 additions & 26 deletions core/core_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func Test_coreLoad(t *testing.T) {

Init(&video.Video{Window: &WindowMock{}}, &MenuMock{})

out := utils.CaptureOutput(func() { Load("testdata/uzem_libretro" + ext) })
out := utils.CaptureOutput(func() { Load("testdata/vecx_libretro" + ext) })

t.Run("The core is loaded", func(t *testing.T) {
if state.Global.Core == nil {
Expand All @@ -46,12 +46,12 @@ func Test_coreLoad(t *testing.T) {

t.Run("Logs information about the loaded core", func(t *testing.T) {
got := out
want := `[Core]: Name: Uzem
[Core]: Version: v2.0
[Core]: Valid extensions: uze
want := `[Core]: Name: VecX
[Core]: Version: 1.2 42366f8
[Core]: Valid extensions: bin|vec
[Core]: Need fullpath: false
[Core]: Block extract: false
[Core]: Core loaded: Uzem
[Core]: Core loaded: VecX
`
if got != want {
t.Errorf("got = %v, want %v", got, want)
Expand All @@ -77,52 +77,52 @@ func Test_getGameInfo(t *testing.T) {
}{
{
name: "Returns the right path and size for an unzipped ROM",
args: args{filename: "testdata/ZoomingSecretary.uze", blockExtract: false},
args: args{filename: "testdata/Polar Rescue (USA).vec", blockExtract: false},
want: &libretro.GameInfo{
Path: "testdata/ZoomingSecretary.uze",
Size: 61286,
Path: "testdata/Polar Rescue (USA).vec",
Size: 8192,
},
wantErr: false,
},
{
name: "Returns the right path and size for a zipped ROM",
args: args{filename: "testdata/ZoomingSecretary.zip", blockExtract: false},
args: args{filename: "testdata/Polar Rescue (USA).zip", blockExtract: false},
want: &libretro.GameInfo{
Path: os.TempDir() + "/ZoomingSecretary.uze",
Size: 61286,
Path: os.TempDir() + "/Polar Rescue (USA).vec",
Size: 8192,
},
wantErr: false,
},
{
name: "Returns the right path and size for a zipped ROM with blockExtract",
args: args{filename: "testdata/ZoomingSecretary.zip", blockExtract: true},
args: args{filename: "testdata/Polar Rescue (USA).zip", blockExtract: true},
want: &libretro.GameInfo{
Path: "testdata/ZoomingSecretary.zip",
Size: 25599,
Path: "testdata/Polar Rescue (USA).zip",
Size: 6829,
},
wantErr: false,
},
{
name: "Returns the right path and size for a zipped ROM with blockExtract",
args: args{filename: "testdata/ZoomingSecretary.zip", blockExtract: true},
args: args{filename: "testdata/Polar Rescue (USA).zip", blockExtract: true},
want: &libretro.GameInfo{
Path: "testdata/ZoomingSecretary.zip",
Size: 25599,
Path: "testdata/Polar Rescue (USA).zip",
Size: 6829,
},
wantErr: false,
},
{
name: "Returns an error when a file doesn't exists",
args: args{filename: "testdata/ZoomingSecretary2.zip", blockExtract: true},
args: args{filename: "testdata/Polar Rescue (USA)2.zip", blockExtract: true},
want: nil,
wantErr: true,
},
{
name: "Doesn't attempt to unzip a file that has no .zip extension",
args: args{filename: "testdata/ZoomingSecretary.uze", blockExtract: true},
args: args{filename: "testdata/Polar Rescue (USA).vec", blockExtract: true},
want: &libretro.GameInfo{
Path: "testdata/ZoomingSecretary.uze",
Size: 61286,
Path: "testdata/Polar Rescue (USA).vec",
Size: 8192,
},
wantErr: false,
},
Expand Down Expand Up @@ -154,21 +154,21 @@ func Test_unzipGame(t *testing.T) {
}{
{
name: "Should unzip to the right path",
args: args{filename: "testdata/ZoomingSecretary.zip"},
want: os.TempDir() + "/ZoomingSecretary.uze",
want1: 61286,
args: args{filename: "testdata/Polar Rescue (USA).zip"},
want: os.TempDir() + "/Polar Rescue (USA).vec",
want1: 8192,
wantErr: false,
},
{
name: "Returns an error if the file is not a zip",
args: args{filename: "testdata/ZoomingSecretary.uze"},
args: args{filename: "testdata/Polar Rescue (USA).vec"},
want: "",
want1: 0,
wantErr: true,
},
{
name: "Returns an error if the file doesn't exists",
args: args{filename: "testdata/ZoomingSecretary2.zip"},
args: args{filename: "testdata/Polar Rescue (USA)2.zip"},
want: "",
want1: 0,
wantErr: true,
Expand Down
Binary file added core/testdata/Polar Rescue (USA).vec
Binary file not shown.
Binary file added core/testdata/Polar Rescue (USA).zip
Binary file not shown.
Binary file removed core/testdata/ZoomingSecretary.uze
Binary file not shown.
Binary file removed core/testdata/ZoomingSecretary.zip
Binary file not shown.
Binary file removed core/testdata/uzem_libretro.dylib
Binary file not shown.
Binary file removed core/testdata/uzem_libretro.so
Binary file not shown.
Binary file added core/testdata/vecx_libretro.dll
Binary file not shown.
Binary file added core/testdata/vecx_libretro.dylib
Binary file not shown.
Binary file added core/testdata/vecx_libretro.so
Binary file not shown.

0 comments on commit 522fd7c

Please sign in to comment.