-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use testscript to test go-chromecast command helptext and the version. Added _maybe_ working github action to test.
- Loading branch information
Showing
11 changed files
with
126 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: Test | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
test: | ||
strategy: | ||
matrix: | ||
go-version: [1.12.x] | ||
platform: [ubuntu-latest, macos-latest] | ||
runs-on: ${{ matrix.platform }} | ||
steps: | ||
- name: Install Go | ||
uses: actions/setup-go@v1 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
- name: Checkout code | ||
uses: actions/checkout@v1 | ||
- name: Test | ||
run: go test ./... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package main | ||
|
||
import ( | ||
"os" | ||
"testing" | ||
|
||
"github.com/rogpeppe/go-internal/testscript" | ||
) | ||
|
||
func TestMain(m *testing.M) { | ||
os.Exit(testscript.RunMain(m, map[string]func() int{ | ||
"go-chromecast": main1, | ||
})) | ||
} | ||
|
||
func TestCommands(t *testing.T) { | ||
testscript.Run(t, testscript.Params{ | ||
Dir: "testdata", | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# hello world | ||
exec cat hello.text | ||
stdout 'hello world\n' | ||
! stderr . | ||
|
||
-- hello.text -- | ||
hello world |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# Check Helptext | ||
go-chromecast | ||
cmp stdout expected-helptext.txt | ||
! stderr . | ||
|
||
|
||
-- expected-helptext.txt -- | ||
Control your Google Chromecast or Google Home Mini from the | ||
command line. | ||
|
||
Usage: | ||
go-chromecast [flags] | ||
go-chromecast [command] | ||
|
||
Available Commands: | ||
help Help about any command | ||
load Load and play media on the chromecast | ||
ls List devices | ||
next Play the next available media | ||
pause Pause the currently playing media on the chromecast | ||
playlist Load and play media on the chromecast | ||
previous Play the previous available media | ||
restart Restart the currently playing media | ||
rewind Rewind by seconds the currently playing media | ||
seek Seek by seconds into the currently playing media | ||
status Current chromecast status | ||
stop Stop casting | ||
tts text-to-speech | ||
ui Run the UI | ||
unpause Unpause the currently playing media on the chromecast | ||
volume Get or set volume | ||
watch Watch all events sent from a chromecast device | ||
|
||
Flags: | ||
-a, --addr string Address of the chromecast device | ||
-v, --debug debug logging | ||
-d, --device string chromecast device, ie: 'Chromecast' or 'Google Home Mini' | ||
-n, --device-name string chromecast device name | ||
--disable-cache disable the cache | ||
-h, --help help for go-chromecast | ||
-i, --iface string Network interface to use when looking for a local address to use for the http server | ||
-p, --port string Port of the chromecast device if 'addr' is specified (default "8009") | ||
-u, --uuid string chromecast device uuid | ||
--version display command version | ||
--with-ui run with a UI | ||
|
||
Use "go-chromecast [command] --help" for more information about a command. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Version | ||
go-chromecast --version | ||
stdout 'go-chromecast dev \(master\)' | ||
! stderr . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters