1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

Merge pull request #10185 from bergzand/pr/tests/qdsa_move

tests/qdsa: Move from unittests to regular tests
This commit is contained in:
Gaëtan Harter 2018-11-28 20:06:42 +01:00 committed by GitHub
commit fdde802bd7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 40 additions and 55 deletions

16
tests/pkg_qdsa/Makefile Normal file
View File

@ -0,0 +1,16 @@
include ../Makefile.tests_common
TEST_ON_CI_WHITELIST += all
# qDSA is not 16 bit compatible
BOARD_BLACKLIST := chronos msb-430 msb-430h telosb wsn430-v1_3b wsn430-v1_4 z1
BOARD_INSUFFICIENT_MEMORY := arduino-duemilanove arduino-uno nucleo-f031k6
CFLAGS += -DTHREAD_STACKSIZE_MAIN=\(4*THREAD_STACKSIZE_DEFAULT\)
USEPKG += qDSA
USEMODULE += random
USEMODULE += embunit
include $(RIOTBASE)/Makefile.include

View File

@ -19,7 +19,6 @@
*/ */
#include "embUnit.h" #include "embUnit.h"
#include "tests-qDSA.h"
#include "random.h" #include "random.h"
#include "sign.h" #include "sign.h"
@ -64,7 +63,7 @@ static void test_qDSA_sign_verify(void)
TEST_ASSERT_EQUAL_INT(1, verify(m_result, 0, sm, smlen, pk)); TEST_ASSERT_EQUAL_INT(1, verify(m_result, 0, sm, smlen, pk));
} }
Test *tests_qDSA_all(void) Test *tests_qDSA(void)
{ {
EMB_UNIT_TESTFIXTURES(fixtures) { EMB_UNIT_TESTFIXTURES(fixtures) {
new_TestFixture(test_qDSA_sign_verify), new_TestFixture(test_qDSA_sign_verify),
@ -74,7 +73,10 @@ Test *tests_qDSA_all(void)
return (Test*)&qDSA_tests; return (Test*)&qDSA_tests;
} }
void tests_qDSA(void) int main(void)
{ {
TESTS_RUN(tests_qDSA_all()); TESTS_START();
TESTS_RUN(tests_qDSA());
TESTS_END();
return 0;
} }

18
tests/pkg_qdsa/tests/01-run.py Executable file
View File

@ -0,0 +1,18 @@
#!/usr/bin/env python3
# Copyright (C) 2017 Freie Universität Berlin
#
# This file is subject to the terms and conditions of the GNU Lesser
# General Public License v2.1. See the file LICENSE in the top level
# directory for more details.
import sys
from testrunner import run
def testfunc(child):
child.expect('OK \(\d+ tests\)')
if __name__ == "__main__":
sys.exit(run(testfunc))

View File

@ -231,10 +231,6 @@ ifneq (,$(filter tests-cpp_%, $(UNIT_TESTS)))
export CPPMIX := 1 export CPPMIX := 1
endif endif
ifneq (, $(filter $(AVR_BOARDS), $(BOARD)))
LARGE_STACK_TESTS += tests-qDSA
endif
ifneq (,$(filter $(LARGE_STACK_TESTS), $(UNIT_TESTS))) ifneq (,$(filter $(LARGE_STACK_TESTS), $(UNIT_TESTS)))
CFLAGS += -DTHREAD_STACKSIZE_MAIN=\(4*THREAD_STACKSIZE_DEFAULT+THREAD_EXTRA_STACKSIZE_PRINTF\) CFLAGS += -DTHREAD_STACKSIZE_MAIN=\(4*THREAD_STACKSIZE_DEFAULT+THREAD_EXTRA_STACKSIZE_PRINTF\)
endif endif

View File

@ -1 +0,0 @@
include $(RIOTBASE)/Makefile.base

View File

@ -1,2 +0,0 @@
USEMODULE += random
USEPKG += qDSA

View File

@ -1,44 +0,0 @@
/*
* Copyright (C) 2018 Kaspar Schleiser <kaspar@schleiser.de>
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
*/
/**
* @addtogroup unittests
* @{
*
* @file
* @brief Unittests for the qDSA package
*
* @author Kaspar Schleiser <kaspar@schleiser.de>
*/
#ifndef TESTS_QDSA_H
#define TESTS_QDSA_H
#include "embUnit/embUnit.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief The entry point of this test suite.
*/
void tests_qDSA(void);
/**
* @brief Generates tests for qDSA
*
* @return embUnit tests if successful, NULL if not.
*/
Test *tests_dDSA_tests(void);
#ifdef __cplusplus
}
#endif
#endif /* TESTS_QDSA_H */
/** @} */