mirror of
https://github.com/OpenVPN/openvpn.git
synced 2026-04-28 09:36:45 -04:00
cmocka [1,2] is a testing framework for C. Adding unit test capabilities to the openvpn repository will greatly ease the task of writing correct code. cmocka source code is added as git submodule in ./vendor. A submodule approach has been chosen over a classical library dependency because libcmocka is not available, or only available in very old versions (e.g. on Ubuntu). cmocka is build during 'make check' and installed in vendor/dist/. [1] https://cmocka.org/ [2] https://lwn.net/Articles/558106/ Signed-off-by: Jens Neuhalfen <jens@neuhalfen.name> Acked-by: Steffan Karger <steffan@karger.me> Message-Id: <20160525175756.56186-2-openvpn-devel@neuhalfen.name> URL: http://article.gmane.org/gmane.network.openvpn.devel/11725 Signed-off-by: David Sommerseth <dazo@privateinternetaccess.com>
21 lines
381 B
C
21 lines
381 B
C
#include <stdio.h>
|
|
#include <unistd.h>
|
|
#include <stdlib.h>
|
|
#include <stdarg.h>
|
|
#include <string.h>
|
|
#include <setjmp.h>
|
|
#include <cmocka.h>
|
|
|
|
|
|
static void test_true(void **state) {
|
|
(void) state;
|
|
}
|
|
|
|
|
|
int main(void) {
|
|
const struct CMUnitTest tests[] = {
|
|
cmocka_unit_test(test_true),
|
|
};
|
|
|
|
return cmocka_run_group_tests_name("success_test2", tests, NULL, NULL);
|
|
}
|