mirror of
https://gitlab.crans.org/nounous/ghostream.git
synced 2024-12-22 20:52:20 +00:00
If ffmpeg returns an error, then test failed
This commit is contained in:
parent
708501c5c8
commit
4e066d6c33
@ -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
|
||||||
}
|
}
|
||||||
|
@ -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
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user