@@ -570,6 +570,82 @@ build_and_development:
570
570
description: "Run the unit tests for SRS"
571
571
working_directory: "trunk"
572
572
573
+ run_blackbox_tests:
574
+ description: "Blackbox tests are integration tests that test SRS as a complete system using FFmpeg as client"
575
+ location: "trunk/3rdparty/srs-bench/blackbox/"
576
+
577
+ prerequisites:
578
+ - "SRS server binary must be built first (make -j in trunk/)"
579
+ - "FFmpeg and FFprobe must be available in PATH"
580
+ - "Test media files (avatar.flv, etc.) must be present in srs-bench directory"
581
+
582
+ build_blackbox_tests:
583
+ command: "cd trunk/3rdparty/srs-bench && make"
584
+ description: "Build the blackbox test binary"
585
+ output: "./objs/srs_blackbox_test"
586
+
587
+ run_all_tests:
588
+ command: "./objs/srs_blackbox_test -test.v -srs-log -srs-stdout"
589
+ description: "Run all blackbox tests with verbose output and detailed SRS logs"
590
+ working_directory: "trunk/3rdparty/srs-bench"
591
+
592
+ run_specific_test:
593
+ command: "./objs/srs_blackbox_test -test.v -srs-log -srs-stdout -test.run TestName"
594
+ description: "Run a specific test by name (e.g., TestFast_RtmpPublish_DvrFlv_Basic)"
595
+ examples:
596
+ - "./objs/srs_blackbox_test -test.v -srs-log -srs-stdout -test.run TestFast_RtmpPublish_DvrFlv_Basic"
597
+ - "./objs/srs_blackbox_test -test.v -srs-log -srs-stdout -test.run TestFast_RtmpPublish_RtmpPlay_Basic"
598
+ - "./objs/srs_blackbox_test -test.v -srs-log -srs-stdout -test.run 'TestFast_RtmpPublish_Dvr.*'"
599
+
600
+ test_options:
601
+ - flag: "-test.v"
602
+ description: "Verbose output showing test progress (recommended)"
603
+ - flag: "-test.run <pattern>"
604
+ description: "Run only tests matching the pattern (Go regex)"
605
+ - flag: "-srs-log"
606
+ description: "Enable detailed SRS log output (recommended for debugging)"
607
+ - flag: "-srs-stdout"
608
+ description: "Show SRS stdout logs (recommended for debugging)"
609
+ - flag: "-srs-ffmpeg-stderr"
610
+ description: "Show FFmpeg stderr logs"
611
+ - flag: "-srs-ffprobe-stdout"
612
+ description: "Show FFprobe stdout logs"
613
+ - flag: "-srs-binary <path>"
614
+ description: "Specify custom SRS binary path (default: ../../objs/srs)"
615
+ - flag: "-srs-timeout <ms>"
616
+ description: "Timeout for each test case in milliseconds (default: 64000)"
617
+
618
+ how_it_works:
619
+ - "Each blackbox test automatically starts a fresh SRS server instance"
620
+ - "SRS is configured via environment variables (e.g., SRS_VHOST_DVR_ENABLED=on)"
621
+ - "Tests use FFmpeg to publish streams and FFprobe to verify output"
622
+ - "SRS server is automatically stopped when test completes"
623
+ - "Each test runs in isolation with its own SRS instance and random ports"
624
+ - "No need to manually start or stop SRS server"
625
+
626
+ test_categories:
627
+ rtmp: "TestFast_RtmpPublish_RtmpPlay_*, TestFast_RtmpPublish_HttpFlvPlay_*"
628
+ dvr: "TestFast_RtmpPublish_DvrFlv_*, TestFast_RtmpPublish_DvrMp4_*"
629
+ hls: "TestFast_RtmpPublish_HlsPlay_*"
630
+ hevc: "TestSlow_RtmpPublish_*_HEVC_*, TestSlow_SrtPublish_*_HEVC_*"
631
+ srt: "TestFast_SrtPublish_SrtPlay_*"
632
+ rtsp: "TestFast_RtmpPublish_RtspPlay_*"
633
+ http_api: "TestFast_Http_Api_*"
634
+ mp3: "TestFast_RtmpPublish_*_CodecMP3_*"
635
+
636
+ common_workflows:
637
+ quick_test:
638
+ description: "Run a single fast test to verify basic functionality"
639
+ command: "./objs/srs_blackbox_test -test.v -srs-log -srs-stdout -test.run TestFast_RtmpPublish_RtmpPlay_Basic"
640
+
641
+ dvr_tests:
642
+ description: "Run all DVR-related tests"
643
+ command: "./objs/srs_blackbox_test -test.v -srs-log -srs-stdout -test.run 'TestFast_RtmpPublish_Dvr.*'"
644
+
645
+ debug_test:
646
+ description: "Run test with full logging including FFmpeg stderr for debugging"
647
+ command: "./objs/srs_blackbox_test -test.v -srs-log -srs-stdout -srs-ffmpeg-stderr -test.run TestName"
648
+
573
649
testing:
574
650
test_patterns:
575
651
- Note that private and protected members are accessible in utests, as there is a macro to convert them to public
0 commit comments