Skip TestFromFrame if RTMP_TEST_FRAME env var not defined.

This commit is contained in:
scruzin 2019-07-10 09:45:55 +09:30
parent 1728c3a531
commit 7414317429
1 changed files with 4 additions and 1 deletions

View File

@ -173,6 +173,10 @@ func TestErorHandling(t *testing.T) {
// TestFromFrame tests streaming from a single H.264 frame which is repeated.
func TestFromFrame(t *testing.T) {
testLog(0, "TestFromFrame")
testFrame := os.Getenv("RTMP_TEST_FRAME")
if testFrame == "" {
t.Skip("Skipping TestFromFrame since no RTMP_TEST_FRAME")
}
if testKey == "" {
t.Skip("Skipping TestFromFrame since no RTMP_TEST_KEY")
}
@ -181,7 +185,6 @@ func TestFromFrame(t *testing.T) {
t.Errorf("Dial failed with error: %v", err)
}
testFrame := os.Getenv("RTMP_TEST_FRAME")
b, err := ioutil.ReadFile(testFrame)
if err != nil {
t.Errorf("ReadFile failed with error: %v", err)