Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MAINT/TEST] Added custom main with transparent parameters #2681

Merged
merged 7 commits into from
Aug 8, 2023

Conversation

ethouris
Copy link
Collaborator

@ethouris ethouris commented Mar 6, 2023

Fixes #2611

This adds the custom main function for gtest and allows parameters to be interpreted in the test function.

This is waiting for a solution for startup/cleanup part consistency with gtest exception policy. This PR provides an extra singleton class that would prepare the parameters; this can be linked with a special per-test used object that would interpret these parameters.

The syntax for the test options is beside the options for gtest. All gtest options start with --gtest and parameters are passed by equal sign. All of them are removed from the command line by gtest and the others are free to take. Syntax:

free_value1 -option1 value -option2 value1 value2 value3 -/ free_value2 free_value3 -option3 -- -value4 -value5 value6

Here free_value represents an argument without an option and options are provided by dash prefix. The -/ ends the list of argument for a current option and can separate per-option parameter from the following parameters.

Options can be potentially used for general options as well as per-test options. Options can be extracted either from SrtTestEnv::me->args as the original command line and from SrtTestEnv::me->argmap using the option names as keys (without the initial dash). Multiple arguments are packed into a vector and can be glued together on demand by OptionValue method.

Currently there are two options handled (no arguments):

  • -logdebug: if present, every test gets an additional call to srt_setloglevel(LOG_DEBUG)
  • -disable-ipv6: tests that have the declaration SRTST_REQUIRE(IPv6) will be forcefully-passed and not executed

@ethouris ethouris added Type: Maintenance Work required to maintain or clean up the code [tests] Area: Unit tests labels Mar 6, 2023
@ethouris ethouris marked this pull request as ready for review March 8, 2023 14:42
@riv184 riv184 mentioned this pull request Mar 26, 2023
ethouris pushed a commit to ethouris/srt that referenced this pull request May 3, 2023
@ethouris ethouris added this to the v1.6.0 milestone May 4, 2023
@maxsharabayko maxsharabayko merged commit 9f41437 into Haivision:master Aug 8, 2023
@maxsharabayko maxsharabayko modified the milestones: v1.6.0, v1.5.3 Aug 8, 2023
guilletrejo added a commit to swxtchio/srt that referenced this pull request Aug 23, 2023
* [core] Fix crypto mode auto for listener sender (Haivision#2711).


Co-authored-by: oviano <ovcollyer@mac.com>

* [build] Upgraded CI: ubuntu to version 20.04 (Haivision#2682).

* [docs] Added the link for registration in slack to the getting started table (Haivision#2721).

* [core] Fixed FEC Emergency resize crash (Haivision#2717).

Fixed minimum history condition.

* [core] Fixed various compiler warnings on various platforms (Haivision#2679).

* [core] Minor fix of variable shadowing.

* [tests] Minor fix of variable shadowing.

* [build] Add -Wshadow=local to CMake build flags.
Supported since GCC 7.0.

* [core] Correct remaining endianness issues

Fixes the last two remaining test failures on big-endian.  These
operations were all already no-ops on little-endian, and unnecessarily
byteswapped the IP addresses on big-endian.

Closes: Haivision#2697

* [docs] Minor updates to AEAD docs plus changed v1.6.0 to 1.5.2 in some files

* [build] Fix downversioning of _WIN32_WINNT (Haivision#2754).

* [core] Fixed unhandled error in haicrypt (Haivision#2685).

* [core] Use overlapped WSASendTo to avoid loss in UDP sending (Haivision#2632).

* [core] Add volatile keyword to asm block in rdtsc (Haivision#2759).

* [core] Fixed srctime from closing socket was mistakenly cleared

* [core] Fixed group read-ready epoll events.

* [core] Removed unused CUDTGroup::m_Positions.

* [core] Perf improvement of group reading.

* [core] Fixed RCV buffer initialization in Rendezvous.

* [docs] Updating the explicit information for binding to IPv6 wildcard (Haivision#2765).

* [tests] Added custom main with transparent parameters for tests (Haivision#2681).

* [core] Fix memory leak when can't buffer a HS packet (Haivision#2757).

* [core] Refactor CRcvQueue::storePkt(..) for better resource management (Haivision#2775).

* [core] Fix hang up on not enough space in the RCV buffer (Haivision#2745).

When there is space available in the receiving buffer after it is full,
send an ack to allow the sender to resume transmission.
Reschedule sending if ACK decreases the flight span after sending is congested.

Co-authored-by: Maxim Sharabayko <maxlovic@gmail.com>

* [core] fix tsbpd() may deadlock with processCtrlShutdown()

* [core] Slightly optimize the RCV drop by message number (Haivision#2686).

Some minor improvements of logs and comments.

* [core] Rejection not undertaken in rendezvous after KMX failure (Haivision#2692).

* [core] Fix: In rendezvous when processing resulted in ACCEPT it was still sending rejection

* [core] Minor code clean up in CRateEstimator.

* [core] Initialize ISN and PeerISN in CUDT.

* [core] Drop unencrypted packets in GCM mode.

* [apps] Fix the build for target without IP_ADD_SOURCE_MEMBERSHIP (Haivision#2779).

* [core] Added maximum BW limit for retransmissions (Haivision#2714).

* [API] SRT version raised to 1.5.3.

* [apps] Fixed conditional IP_ADD_SOURCE_MEMBERSHIP in testmedia (Haivision#2780).

* [core] Fixed SRT_ATTR_REQUIRES use.

* [build] Added missing public header files in Windows binary installer (Haivision#2784).

The header file access_control.h was added to the source tree
at some point but was not added to the Windows installer.

---------

Co-authored-by: Maxim Sharabayko <maxlovic@gmail.com>
Co-authored-by: oviano <ovcollyer@mac.com>
Co-authored-by: Sektor van Skijlen <ethouris@gmail.com>
Co-authored-by: Maria Sharabayko <41019697+mbakholdina@users.noreply.github.com>
Co-authored-by: Maxim Sharabayko <maxsharabayko@haivision.com>
Co-authored-by: matoro <matoro@users.noreply.github.com>
Co-authored-by: Maria Sharabayko <msharabayko@haivision.com>
Co-authored-by: Steve Lhomme <robux4@ycbcr.xyz>
Co-authored-by: Aaron Jencks <32805004+aaron-jencks@users.noreply.github.com>
Co-authored-by: Guangqing Chen <hi@goushi.me>
Co-authored-by: john <hondaxiao@tencent.com>
Co-authored-by: yomnes0 <127947185+yomnes0@users.noreply.github.com>
Co-authored-by: Mikołaj Małecki <mmalecki@haivision.com>
Co-authored-by: Jose Santiago <jsantiago@haivision.com>
Co-authored-by: Thierry Lelegard <lelegard@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[tests] Area: Unit tests Type: Maintenance Work required to maintain or clean up the code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[MAINT/TEST] Maintain integrity for startup/shutdown calls in the test cases
2 participants