Skip to content

Commit

Permalink
tests: reorganize files
Browse files Browse the repository at this point in the history
  • Loading branch information
changkun committed Aug 24, 2021
1 parent 78c0ed6 commit e75e871
Show file tree
Hide file tree
Showing 13 changed files with 22 additions and 10 deletions.
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
#
# Written by Changkun Ou <changkun.de>

FROM golang:1.16
FROM golang:1.17
RUN apt-get update && apt-get install -y \
xvfb libx11-dev \
xvfb libx11-dev libegl1-mesa-dev libgles2-mesa-dev \
&& apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
WORKDIR /app
COPY . .
CMD [ "sh", "-c", "./test-docker.sh" ]
CMD [ "sh", "-c", "./tests/test-docker.sh" ]
4 changes: 2 additions & 2 deletions clipboard_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func init() {

func TestClipboard(t *testing.T) {
t.Run("image", func(t *testing.T) {
data, err := os.ReadFile("testdata/clipboard.png")
data, err := os.ReadFile("tests/testdata/clipboard.png")
if err != nil {
t.Fatalf("failed to read gold file: %v", err)
}
Expand Down Expand Up @@ -92,7 +92,7 @@ func TestClipboard(t *testing.T) {
}

func TestClipboardMultipleWrites(t *testing.T) {
data, err := os.ReadFile("testdata/clipboard.png")
data, err := os.ReadFile("tests/testdata/clipboard.png")
if err != nil {
t.Fatalf("failed to read gold file: %v", err)
}
Expand Down
6 changes: 3 additions & 3 deletions cmd/gclip-gui/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ provided in the [GoMobile wiki](https://github.com/golang/go/wiki/Mobile) page.

## Screenshots

| macOS | iOS | Windows | Android |
|:------:|:---:|:------:|:-------:|
|![](./darwin.png)|![](./ios.png)|![](./windows.png)|![](./android.png)|
| macOS | iOS | Windows | Android | Linux |
|:-----:|:---:|:-------:|:-------:|:-----:|
|![](../../tests/testdata/darwin.png)|![](../../tests/testdata/ios.png)|![](../../tests/testdata/windows.png)|![](../../tests/testdata/android.png)|![](../../tests/testdata/linux.png)|

## License

Expand Down
6 changes: 6 additions & 0 deletions example_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
// Copyright 2021 The golang.design Initiative Authors.
// All rights reserved. Use of this source code is governed
// by a MIT license that can be found in the LICENSE file.
//
// Written by Changkun Ou <changkun.de>

package clipboard_test

import (
Expand Down
6 changes: 6 additions & 0 deletions export_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
// Copyright 2021 The golang.design Initiative Authors.
// All rights reserved. Use of this source code is governed
// by a MIT license that can be found in the LICENSE file.
//
// Written by Changkun Ou <changkun.de>

package clipboard

// for debugging errors
Expand Down
4 changes: 2 additions & 2 deletions Makefile → tests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
all: test

test:
go test -v -count=1 -covermode=atomic ./...
go test -v -count=1 -covermode=atomic ..

test-docker:
docker build -t golang-design/x/clipboard .
docker build -t golang-design/x/clipboard ..
docker run --rm --name cb golang-design/x/clipboard
docker rmi golang-design/x/clipboard
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Binary file added tests/testdata/linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes

0 comments on commit e75e871

Please sign in to comment.