mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-12-25 14:33:52 +01:00
tests/qdsa: Move from unittests to regular tests
Stack size is changed from 4 times the default + printf to 5 times the default stack size. Only on the lpc2387 this reduces the resulting stack space. the test is not rerun for the lpc2387 and is untested.
This commit is contained in:
parent
4eaf1d8135
commit
f9eebce43f
16
tests/pkg_qdsa/Makefile
Normal file
16
tests/pkg_qdsa/Makefile
Normal 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
|
||||
@ -19,7 +19,6 @@
|
||||
*/
|
||||
|
||||
#include "embUnit.h"
|
||||
#include "tests-qDSA.h"
|
||||
|
||||
#include "random.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 *tests_qDSA_all(void)
|
||||
Test *tests_qDSA(void)
|
||||
{
|
||||
EMB_UNIT_TESTFIXTURES(fixtures) {
|
||||
new_TestFixture(test_qDSA_sign_verify),
|
||||
@ -74,7 +73,10 @@ Test *tests_qDSA_all(void)
|
||||
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
18
tests/pkg_qdsa/tests/01-run.py
Executable 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))
|
||||
@ -231,10 +231,6 @@ ifneq (,$(filter tests-cpp_%, $(UNIT_TESTS)))
|
||||
export CPPMIX := 1
|
||||
endif
|
||||
|
||||
ifneq (, $(filter $(AVR_BOARDS), $(BOARD)))
|
||||
LARGE_STACK_TESTS += tests-qDSA
|
||||
endif
|
||||
|
||||
ifneq (,$(filter $(LARGE_STACK_TESTS), $(UNIT_TESTS)))
|
||||
CFLAGS += -DTHREAD_STACKSIZE_MAIN=\(4*THREAD_STACKSIZE_DEFAULT+THREAD_EXTRA_STACKSIZE_PRINTF\)
|
||||
endif
|
||||
|
||||
@ -1 +0,0 @@
|
||||
include $(RIOTBASE)/Makefile.base
|
||||
@ -1,2 +0,0 @@
|
||||
USEMODULE += random
|
||||
USEPKG += qDSA
|
||||
@ -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 */
|
||||
/** @} */
|
||||
Loading…
x
Reference in New Issue
Block a user