Skip to content
Snippets Groups Projects
Unverified Commit f9eebce4 authored by Koen Zandberg's avatar Koen Zandberg
Browse files

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.
parent 4eaf1d81
No related branches found
No related tags found
No related merge requests found
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;
}
#!/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
......
include $(RIOTBASE)/Makefile.base
USEMODULE += random
USEPKG += qDSA
/*
* 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 */
/** @} */
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment