[OpenSIPS-Devel] [OpenSIPS/opensips] 4990e6: Add support for writing module unit tests

Liviu Chircu noreply at github.com
Tue Apr 14 11:25:11 EST 2020

  Branch: refs/heads/feature/rfc-8599-sip-pn
  Home:   https://github.com/OpenSIPS/opensips
  Commit: 4990e69699bcf4094519fbf4597786da9acdfd60
  Author: Liviu Chircu <liviu at opensips.org>
  Date:   2020-04-14 (Tue, 14 Apr 2020)

  Changed paths:
    M Makefile.modules
    M Makefile.test
    M globals.h
    M main.c
    A modules/registrar/test/opensips.cfg
    A modules/registrar/test/test.c
    M sr_module.c
    M sr_module.h
    M test/unit_tests.c
    M test/unit_tests.h

  Log Message:
  Add support for writing module unit tests

Developers may easily write module unit tests as follows:

    1. any testing code .c files must be placed in modules/<mod>/test/
    2. you must provide a "modules/<mod>/test/opensips.cfg" file for the
       module tests to run on top of
         (TODO: ideally, there should be support for multiple of these)
    3. the tests will be executed using an entry-point function,
       which _must_ be named "mod_tests:
	    typedef int (*mod_tests_f) (void);
    4. "make test module=registrar" in order to start OpenSIPS using
       your opensips.cfg and run your 'mod_tests' function

More information about the Devel mailing list