Skip to content

Commit dce6864

Browse files
authored
Merge pull request #16 from bugsnag/kattrali/windows-support
2 parents d4891a2 + a1a1ee2 commit dce6864

File tree

5 files changed

+40
-30
lines changed

5 files changed

+40
-30
lines changed

.github/workflows/test-package.yml

+8-13
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,25 @@ on: [ push, pull_request ]
55
jobs:
66
test:
77

8-
runs-on: ubuntu-latest
8+
runs-on: ${{ matrix.os }}-latest
99
defaults:
1010
run:
1111
working-directory: 'go/src/github.com/bugsnag/panicwrap' # relative to $GITHUB_WORKSPACE
1212
strategy:
1313
fail-fast: false
1414
matrix:
15-
go-version: ['1.7', '1.8', '1.9', '1.10', '1.11', '1.12', '1.13', '1.14', '1.15']
15+
os: [ubuntu, windows]
16+
go-version: ['1.9', '1.10', '1.11', '1.12', '1.13', '1.14', '1.15']
1617

1718
steps:
1819
- uses: actions/checkout@v2
1920
with:
2021
path: 'go/src/github.com/bugsnag/panicwrap' # relative to $GITHUB_WORKSPACE
21-
- name: setup go ${{ matrix.go-version }}
22-
run: |
23-
curl --silent --location --output gimme https://github.com/travis-ci/gimme/raw/v1.5.4/gimme
24-
chmod +x ./gimme
25-
eval "$(./gimme ${{ matrix.go-version }})"
26-
echo "GOOS=" >> $GITHUB_ENV
27-
echo "GOARCH=" >> $GITHUB_ENV
28-
echo "GOROOT=$GOROOT" >> $GITHUB_ENV
29-
echo "PATH=$PATH" >> $GITHUB_ENV
30-
echo "GIMME_ENV=$GIMME_ENV" >> $GITHUB_ENV
31-
echo "GOPATH=$GITHUB_WORKSPACE/go" >> $GITHUB_ENV
22+
- name: set GOPATH
23+
run: echo "GOPATH=$GITHUB_WORKSPACE/go" >> $GITHUB_ENV
24+
- uses: actions/setup-go@v2
25+
with:
26+
go-version: ${{ matrix.go-version }}
3227
- name: install dependencies
3328
run: go get -v -d ./...
3429
- name: run tests

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## TBD
2+
3+
### Bug fixes
4+
5+
* Fix windows support by removing undefined syscall
6+
17
## 1.3.0 (2021-01-05)
28

39
### Features

dup2.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// +build !arm64
1+
// +build !arm64,!windows
22

33
package panicwrap
44

panicwrap_monitor_test.go

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// +build !windows
2+
3+
package panicwrap
4+
5+
import (
6+
"bytes"
7+
"strings"
8+
"testing"
9+
)
10+
11+
func TestPanicWrap_monitor(t *testing.T) {
12+
13+
stdout := new(bytes.Buffer)
14+
15+
p := helperProcess("panic-monitor")
16+
p.Stdout = stdout
17+
//p.Stderr = new(bytes.Buffer)
18+
if err := p.Run(); err == nil || err.Error() != "exit status 2" {
19+
t.Fatalf("err: %s", err)
20+
}
21+
22+
if !strings.Contains(stdout.String(), "wrapped:") {
23+
t.Fatalf("didn't wrap: %#v", stdout.String())
24+
}
25+
}

panicwrap_test.go

-16
Original file line numberDiff line numberDiff line change
@@ -409,22 +409,6 @@ func TestPanicWrap_panicBoundary(t *testing.T) {
409409
}
410410
}
411411

412-
func TestPanicWrap_monitor(t *testing.T) {
413-
414-
stdout := new(bytes.Buffer)
415-
416-
p := helperProcess("panic-monitor")
417-
p.Stdout = stdout
418-
//p.Stderr = new(bytes.Buffer)
419-
if err := p.Run(); err == nil || err.Error() != "exit status 2" {
420-
t.Fatalf("err: %s", err)
421-
}
422-
423-
if !strings.Contains(stdout.String(), "wrapped:") {
424-
t.Fatalf("didn't wrap: %#v", stdout.String())
425-
}
426-
}
427-
428412
func TestWrapped(t *testing.T) {
429413
stdout := new(bytes.Buffer)
430414

0 commit comments

Comments
 (0)