1
0
mirror of https://gitlab.crans.org/nounous/ghostream.git synced 2024-12-23 00:22:19 +00:00

If ffmpeg returns an error, then test failed

This commit is contained in:
Alexandre Iooss 2020-10-04 21:05:42 +02:00
parent 708501c5c8
commit 4e066d6c33
No known key found for this signature in database
GPG Key ID: 6C79278F3FCDCC02
2 changed files with 3 additions and 13 deletions

View File

@ -2,7 +2,6 @@ package forwarding
import ( import (
"bufio" "bufio"
"log"
"os/exec" "os/exec"
"testing" "testing"
"time" "time"
@ -41,7 +40,7 @@ func TestForwardStream(t *testing.T) {
go func() { go func() {
scanner := bufio.NewScanner(forwardingErrOutput) scanner := bufio.NewScanner(forwardingErrOutput)
for scanner.Scan() { for scanner.Scan() {
log.Printf("[FFMPEG FORWARD TEST] %s", scanner.Text()) t.Fatalf("ffmpeg virtual RTMP server returned %s", scanner.Text())
} }
}() }()
@ -72,18 +71,11 @@ func TestForwardStream(t *testing.T) {
go func() { go func() {
scanner := bufio.NewScanner(errOutput) scanner := bufio.NewScanner(errOutput)
for scanner.Scan() { for scanner.Scan() {
log.Printf("[FFMPEG TEST] %s", scanner.Text()) t.Fatalf("ffmpeg virtual source returned %s", scanner.Text())
} }
}() }()
time.Sleep(5 * time.Second) // Delay is in nanoseconds, here 5s time.Sleep(5 * time.Second) // Delay is in nanoseconds, here 5s
// FIXME
//if ffmpegInputStreams["demo"] == nil {
//t.Errorf("Stream forwarding does not appear to be working")
//}
// TODO Check that FFMPEG has no error
// TODO Check that the stream ran
// TODO Kill SRT server // TODO Kill SRT server
} }

View File

@ -2,7 +2,6 @@ package srt
import ( import (
"bufio" "bufio"
"log"
"os/exec" "os/exec"
"testing" "testing"
"time" "time"
@ -54,12 +53,11 @@ func TestServeSRT(t *testing.T) {
go func() { go func() {
scanner := bufio.NewScanner(errOutput) scanner := bufio.NewScanner(errOutput)
for scanner.Scan() { for scanner.Scan() {
log.Printf("[FFMPEG TEST] %s", scanner.Text()) t.Fatalf("ffmpeg virtual source returned %s", scanner.Text())
} }
}() }()
time.Sleep(5 * time.Second) // Delay is in nanoseconds, here 5s time.Sleep(5 * time.Second) // Delay is in nanoseconds, here 5s
// TODO Check that the stream ran
// TODO Kill SRT server // TODO Kill SRT server
} }