add stub for the API test

pull/32/head
John Safranek 2017-06-13 09:15:44 -07:00
parent efeb9a41b2
commit c3d0c895d2
4 changed files with 71 additions and 1 deletions

28
tests/api.c 100644
View File

@ -0,0 +1,28 @@
/* api.c
*
* Copyright (C) 2014-2017 wolfSSL Inc.
*
* This file is part of wolfSSH.
*
* wolfSSH is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* wolfSSH is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with wolfSSH. If not, see <http://www.gnu.org/licenses/>.
*/
#include <tests/unit.h>
int ApiTest(void)
{
return 0;
}

View File

@ -5,7 +5,7 @@
check_PROGRAMS += tests/unit.test check_PROGRAMS += tests/unit.test
noinst_PROGRAMS += tests/unit.test noinst_PROGRAMS += tests/unit.test
tests_unit_test_SOURCES = tests/unit.c tests_unit_test_SOURCES = tests/unit.c tests/api.c
tests_unit_test_CFLAGS = -DNO_MAIN_DRIVER $(AM_CFLAGS) tests_unit_test_CFLAGS = -DNO_MAIN_DRIVER $(AM_CFLAGS)
tests_unit_test_LDADD = src/libwolfssh.la $(LIB_STATIC_ADD) tests_unit_test_LDADD = src/libwolfssh.la $(LIB_STATIC_ADD)

View File

@ -23,6 +23,7 @@
#include <wolfssh/ssh.h> #include <wolfssh/ssh.h>
#include <wolfssh/keygen.h> #include <wolfssh/keygen.h>
#include <wolfssh/internal.h> #include <wolfssh/internal.h>
#include <tests/unit.h>
/* Utility functions */ /* Utility functions */
@ -393,6 +394,10 @@ int main(void)
testResult = testResult || unitResult; testResult = testResult || unitResult;
#endif #endif
unitResult = ApiTest();
printf("API: %s\n", (unitResult == 0 ? "SUCCESS" : "FAILED"));
testResult = testResult || unitResult;
return (testResult ? 1 : 0); return (testResult ? 1 : 0);
} }

37
tests/unit.h 100644
View File

@ -0,0 +1,37 @@
/* unit.h
*
* Copyright (C) 2014-2016 wolfSSL Inc.
*
* This file is part of wolfSSH.
*
* wolfSSH is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* wolfSSH is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with wolfSSH. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* The unit module contains the main driver for the wolfSSH unit tests.
*/
#pragma once
#ifdef __cplusplus
extern "C" {
#endif
int ApiTest(void);
#ifdef __cplusplus
}
#endif