Skip to content
Snippets Groups Projects
Unverified Commit 40187e81 authored by Gaëtan Harter's avatar Gaëtan Harter Committed by GitHub
Browse files

Merge pull request #10184 from bergzand/pr/tests/tweetnacl_move

tests/tweetnacl: Move from unittests to regular test
parents 059ef5c4 137e4825
Branches
No related tags found
No related merge requests found
include ../Makefile.tests_common
BOARD_INSUFFICIENT_MEMORY := arduino-duemilanove \
arduino-uno \
arduino-mega2560 \
mega-xplained \
nucleo-f031k6 \
nucleo-f042k6 \
#
TEST_ON_CI_WHITELIST += native
CFLAGS += -DTHREAD_STACKSIZE_MAIN=\(5*THREAD_STACKSIZE_DEFAULT\)
USEPKG += tweetnacl
USEMODULE += embunit
include $(RIOTBASE)/Makefile.include
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
#include <tweetnacl.h> #include <tweetnacl.h>
#include "embUnit.h" #include "embUnit.h"
#include "tests-tweetnacl.h" #include "random.h"
static const char message[] = "0123456789abcdef"; static const char message[] = "0123456789abcdef";
static char r[sizeof(message)]; static char r[sizeof(message)];
...@@ -127,7 +127,7 @@ static void test_tweetnacl_03(void) ...@@ -127,7 +127,7 @@ static void test_tweetnacl_03(void)
TEST_ASSERT_EQUAL_INT(-1, res); TEST_ASSERT_EQUAL_INT(-1, res);
} }
Test *tests_tweetnacl_all(void) Test *tests_tweetnacl(void)
{ {
EMB_UNIT_TESTFIXTURES(fixtures) { EMB_UNIT_TESTFIXTURES(fixtures) {
new_TestFixture(test_tweetnacl_01), new_TestFixture(test_tweetnacl_01),
...@@ -139,7 +139,10 @@ Test *tests_tweetnacl_all(void) ...@@ -139,7 +139,10 @@ Test *tests_tweetnacl_all(void)
return (Test*)&tweetnacl_tests; return (Test*)&tweetnacl_tests;
} }
void tests_tweetnacl(void) int main(void)
{ {
TESTS_RUN(tests_tweetnacl_all()); TESTS_START();
TESTS_RUN(tests_tweetnacl());
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 os
import sys
from testrunner import run
def testfunc(child):
board = os.environ['BOARD']
# Increase timeout on "real" hardware
timeout = 120 if board is not 'native' else -1
child.expect(r'OK \(\d+ tests\)', timeout=timeout)
if __name__ == "__main__":
sys.exit(run(testfunc))
...@@ -235,7 +235,6 @@ ifneq (, $(filter $(AVR_BOARDS), $(BOARD))) ...@@ -235,7 +235,6 @@ ifneq (, $(filter $(AVR_BOARDS), $(BOARD)))
LARGE_STACK_TESTS += tests-qDSA LARGE_STACK_TESTS += tests-qDSA
endif endif
LARGE_STACK_TESTS += tests-tweetnacl
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
......
include $(RIOTBASE)/Makefile.base
USEMODULE += random
USEPKG += tweetnacl
/*
* Copyright (C) 2016 Martin Landsmann
*
* 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 ``tweetnacl`` package
*
* @author Martin Landsmann <Martin.Landsmann@HAW-Hamburg.de>
*/
#ifndef TESTS_TWEETNACL_H
#define TESTS_TWEETNACL_H
#include "embUnit/embUnit.h"
#include "random.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief The entry point of this test suite.
*/
void tests_tweetnacl(void);
#ifdef __cplusplus
}
#endif
#endif /* TESTS_TWEETNACL_H */
/** @} */
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment