mirror of
https://gitlab.crans.org/nounous/ghostream.git
synced 2024-12-22 18:32:19 +00:00
Skip stream tests if ffmpeg is not installed
This commit is contained in:
parent
3c21f744e8
commit
e8b145550e
@ -6,7 +6,7 @@ unit_tests:
|
||||
image: golang:1.15-alpine
|
||||
stage: test
|
||||
before_script:
|
||||
- apk add --no-cache build-base ffmpeg gcc
|
||||
- apk add --no-cache build-base gcc
|
||||
- apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing libsrt-dev
|
||||
script:
|
||||
- go test -v -covermode=count -coverprofile cover.cov ./...
|
||||
|
@ -23,6 +23,19 @@ func TestSplitHostPort(t *testing.T) {
|
||||
|
||||
// TestServeSRT Serve a SRT server, stream content during 5 seconds and ensure that it is well received
|
||||
func TestServeSRT(t *testing.T) {
|
||||
which := exec.Command("which", "ffmpeg")
|
||||
if err := which.Start(); err != nil {
|
||||
t.Fatal("Error while checking if ffmpeg got installed:", err)
|
||||
}
|
||||
state, err := which.Process.Wait()
|
||||
if err != nil {
|
||||
t.Fatal("Error while checking if ffmpeg got installed:", err)
|
||||
}
|
||||
if state.ExitCode() != 0 {
|
||||
// FFMPEG is not installed
|
||||
t.Skip("WARNING: FFMPEG is not installed. Skipping stream test")
|
||||
}
|
||||
|
||||
go Serve(&Options{ListenAddress: ":9711", MaxClients: 2})
|
||||
|
||||
ffmpeg := exec.Command("ffmpeg",
|
||||
|
Loading…
Reference in New Issue
Block a user