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

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

tests/tweetnacl: Move from unittests to regular test
This commit is contained in:
Gaëtan Harter 2018-10-25 12:27:16 +02:00 committed by GitHub
commit 40187e81fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 47 additions and 46 deletions

View File

@ -0,0 +1,18 @@
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

View File

@ -23,7 +23,7 @@
#include <tweetnacl.h>
#include "embUnit.h"
#include "tests-tweetnacl.h"
#include "random.h"
static const char message[] = "0123456789abcdef";
static char r[sizeof(message)];
@ -127,7 +127,7 @@ static void test_tweetnacl_03(void)
TEST_ASSERT_EQUAL_INT(-1, res);
}
Test *tests_tweetnacl_all(void)
Test *tests_tweetnacl(void)
{
EMB_UNIT_TESTFIXTURES(fixtures) {
new_TestFixture(test_tweetnacl_01),
@ -139,7 +139,10 @@ Test *tests_tweetnacl_all(void)
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;
}

View File

@ -0,0 +1,22 @@
#!/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))

View File

@ -235,7 +235,6 @@ ifneq (, $(filter $(AVR_BOARDS), $(BOARD)))
LARGE_STACK_TESTS += tests-qDSA
endif
LARGE_STACK_TESTS += tests-tweetnacl
ifneq (,$(filter $(LARGE_STACK_TESTS), $(UNIT_TESTS)))
CFLAGS += -DTHREAD_STACKSIZE_MAIN=\(4*THREAD_STACKSIZE_DEFAULT+THREAD_EXTRA_STACKSIZE_PRINTF\)
endif

View File

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

View File

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

View File

@ -1,38 +0,0 @@
/*
* 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 */
/** @} */