Merge pull request #10183 from bergzand/pr/tests/libcose_move
tests/libcose: Move from unittests to regular test
This commit is contained in:
commit
ed1eb8ed9c
20
tests/pkg_libcose/Makefile
Normal file
20
tests/pkg_libcose/Makefile
Normal file
@ -0,0 +1,20 @@
|
||||
include ../Makefile.tests_common
|
||||
|
||||
# HACL* only compiles on 32bit platforms
|
||||
BOARD_BLACKLIST := arduino-duemilanove arduino-mega2560 arduino-uno \
|
||||
jiminy-mega256rfr2 mega-xplained waspmote-pro \
|
||||
chronos msb-430 msb-430h telosb wsn430-v1_3b wsn430-v1_4 z1
|
||||
|
||||
BOARD_INSUFFICIENT_MEMORY := nucleo-f030r8 nucleo-f031k6 nucleo-f042k6 \
|
||||
nucleo-l031k6 nucleo-l053r8 stm32f0discovery
|
||||
|
||||
TEST_ON_CI_WHITELIST += native
|
||||
|
||||
CFLAGS += -DTHREAD_STACKSIZE_MAIN=\(4*THREAD_STACKSIZE_DEFAULT\)
|
||||
|
||||
USEPKG += libcose
|
||||
USEMODULE += libcose_crypt_hacl
|
||||
USEMODULE += memarray
|
||||
USEMODULE += embunit
|
||||
|
||||
include $(RIOTBASE)/Makefile.include
|
||||
@ -12,7 +12,7 @@
|
||||
* @{
|
||||
*
|
||||
* @file
|
||||
* @brief Unit tests for pkg libcose
|
||||
* @brief Tests for pkg libcose
|
||||
*
|
||||
* @author Koen Zandberg <koen@bergzand.net>
|
||||
*/
|
||||
@ -31,8 +31,6 @@
|
||||
#include "memarray.h"
|
||||
#include "random.h"
|
||||
|
||||
#include "tests-libcose.h"
|
||||
|
||||
/* Example payload */
|
||||
static char payload[] = "Input string";
|
||||
/* Key ID's */
|
||||
@ -196,7 +194,7 @@ static void test_libcose_03(void)
|
||||
TEST_ASSERT_EQUAL_INT(plaintext_len, sizeof(payload) - 1);
|
||||
}
|
||||
|
||||
Test *tests_libcose_all(void)
|
||||
Test *tests_libcose(void)
|
||||
{
|
||||
EMB_UNIT_TESTFIXTURES(fixtures) {
|
||||
new_TestFixture(test_libcose_01),
|
||||
@ -208,9 +206,10 @@ Test *tests_libcose_all(void)
|
||||
return (Test *)&libcose_tests;
|
||||
}
|
||||
|
||||
void tests_libcose(void)
|
||||
int main(void)
|
||||
{
|
||||
printf("Starting libcose test, performing multiple signature operations.\n");
|
||||
printf("This can take a while (up to 2 minutes on the samr21-xpro)\n");
|
||||
TESTS_RUN(tests_libcose_all());
|
||||
TESTS_START();
|
||||
TESTS_RUN(tests_libcose());
|
||||
TESTS_END();
|
||||
return 0;
|
||||
}
|
||||
22
tests/pkg_libcose/tests/01-run.py
Executable file
22
tests/pkg_libcose/tests/01-run.py
Executable 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('OK \(\d+ tests\)', timeout=timeout)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(run(testfunc))
|
||||
@ -236,7 +236,6 @@ ifneq (, $(filter $(AVR_BOARDS), $(BOARD)))
|
||||
endif
|
||||
|
||||
LARGE_STACK_TESTS += tests-hacl
|
||||
LARGE_STACK_TESTS += tests-libcose
|
||||
LARGE_STACK_TESTS += tests-tweetnacl
|
||||
ifneq (,$(filter $(LARGE_STACK_TESTS), $(UNIT_TESTS)))
|
||||
CFLAGS += -DTHREAD_STACKSIZE_MAIN=\(4*THREAD_STACKSIZE_DEFAULT+THREAD_EXTRA_STACKSIZE_PRINTF\)
|
||||
|
||||
@ -1 +0,0 @@
|
||||
include $(RIOTBASE)/Makefile.base
|
||||
@ -1,7 +0,0 @@
|
||||
CFLAGS +=-DCOSE_SIGNATURES_MAX=2
|
||||
|
||||
USEPKG += libcose
|
||||
|
||||
USEMODULE += random
|
||||
USEMODULE += memarray
|
||||
USEMODULE += libcose_crypt_hacl
|
||||
@ -1,37 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2018 Freie Universität Berlin
|
||||
* Copyright (C) 2018 Inria
|
||||
*
|
||||
* 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 libcose package
|
||||
*
|
||||
*/
|
||||
#ifndef TESTS_LIBCOSE_H
|
||||
#define TESTS_LIBCOSE_H
|
||||
|
||||
#include "embUnit/embUnit.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief The entry point of this test suite.
|
||||
*/
|
||||
void tests_libcose(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* TESTS_LIBCOSE_H */
|
||||
/** @} */
|
||||
Loading…
x
Reference in New Issue
Block a user