mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
tests/hacl: Move from unittests to regular test
This commit is contained in:
parent
ed1eb8ed9c
commit
052fea24aa
16
tests/pkg_hacl/Makefile
Normal file
16
tests/pkg_hacl/Makefile
Normal file
@ -0,0 +1,16 @@
|
||||
include ../Makefile.tests_common
|
||||
|
||||
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-f031k6 nucleo-f042k6
|
||||
|
||||
TEST_ON_CI_WHITELIST += all
|
||||
|
||||
CFLAGS += -DTHREAD_STACKSIZE_MAIN=\(5*THREAD_STACKSIZE_DEFAULT\)
|
||||
USEPKG += hacl
|
||||
USEMODULE += random
|
||||
USEMODULE += embunit
|
||||
|
||||
include $(RIOTBASE)/Makefile.include
|
@ -22,8 +22,8 @@
|
||||
|
||||
#include <string.h>
|
||||
#include <haclnacl.h>
|
||||
#include "random.h"
|
||||
#include "embUnit.h"
|
||||
#include "tests-hacl.h"
|
||||
|
||||
static const char message[] = "0123456789abcdef";
|
||||
static char r[sizeof(message)];
|
||||
@ -74,7 +74,7 @@ static void test_hacl_01(void)
|
||||
TEST_ASSERT_EQUAL_STRING((const char*)message, (const char*)r);
|
||||
}
|
||||
|
||||
Test *tests_hacl_all(void)
|
||||
Test *tests_hacl(void)
|
||||
{
|
||||
EMB_UNIT_TESTFIXTURES(fixtures) {
|
||||
new_TestFixture(test_hacl_01)
|
||||
@ -84,7 +84,10 @@ Test *tests_hacl_all(void)
|
||||
return (Test*)&hacl_tests;
|
||||
}
|
||||
|
||||
void tests_hacl(void)
|
||||
int main(void)
|
||||
{
|
||||
TESTS_RUN(tests_hacl_all());
|
||||
TESTS_START();
|
||||
TESTS_RUN(tests_hacl());
|
||||
TESTS_END();
|
||||
return 0;
|
||||
}
|
18
tests/pkg_hacl/tests/01-run.py
Executable file
18
tests/pkg_hacl/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))
|
@ -235,7 +235,6 @@ ifneq (, $(filter $(AVR_BOARDS), $(BOARD)))
|
||||
LARGE_STACK_TESTS += tests-qDSA
|
||||
endif
|
||||
|
||||
LARGE_STACK_TESTS += tests-hacl
|
||||
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,2 +0,0 @@
|
||||
USEMODULE += random
|
||||
USEPKG += hacl
|
@ -1,38 +0,0 @@
|
||||
/*
|
||||
* 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 ``hacl`` package
|
||||
*
|
||||
* @author Benjamin Beurdouche <benjamin.beurdouche@inria.fr>
|
||||
*/
|
||||
#ifndef TESTS_HACL_H
|
||||
#define TESTS_HACL_H
|
||||
|
||||
#include "embUnit/embUnit.h"
|
||||
#include "random.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief The entry point of this test suite.
|
||||
*/
|
||||
void tests_hacl(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* TESTS_HACL_H */
|
||||
/** @} */
|
Loading…
Reference in New Issue
Block a user