Incorporated code review comments

This commit is contained in:
Mohammad Azim Khan 2017-07-19 10:15:54 +01:00 committed by Mohammad Azim Khan
parent d61b837fac
commit 9540261a76
7 changed files with 41 additions and 37 deletions

View File

@ -36,6 +36,7 @@ set(NULL_ENTROPY_WARNING "${WARNING_BORDER}"
"${NULL_ENTROPY_WARN_L3}"
"${WARNING_BORDER}")
find_package(PythonInterp)
find_package(Perl)
if(PERL_FOUND)

View File

@ -29,8 +29,8 @@ function(add_test_suite suite_name)
add_custom_command(
OUTPUT test_suite_${data_name}.c
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/scripts/generate_code.py -f ${CMAKE_CURRENT_SOURCE_DIR}/suites/test_suite_${suite_name}.function -d ${CMAKE_CURRENT_SOURCE_DIR}/suites/test_suite_${data_name}.data -t ${CMAKE_CURRENT_SOURCE_DIR}/suites/main_test.function -p ${CMAKE_CURRENT_SOURCE_DIR}/suites/desktop_test.function -s ${CMAKE_CURRENT_SOURCE_DIR}/suites --help-file ${CMAKE_CURRENT_SOURCE_DIR}/suites/helpers.function -o .
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/scripts/generate_code.py mbedtls ${CMAKE_CURRENT_SOURCE_DIR}/suites/helpers.function ${CMAKE_CURRENT_SOURCE_DIR}/suites/main_test.function ${CMAKE_CURRENT_SOURCE_DIR}/suites/desktop_test.function ${CMAKE_CURRENT_SOURCE_DIR}/suites/test_suite_${suite_name}.function ${CMAKE_CURRENT_SOURCE_DIR}/suites/test_suite_${data_name}.data
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/scripts/generate_code.py -f ${CMAKE_CURRENT_SOURCE_DIR}/suites/test_suite_${suite_name}.function -d ${CMAKE_CURRENT_SOURCE_DIR}/suites/test_suite_${data_name}.data -t ${CMAKE_CURRENT_SOURCE_DIR}/suites/main_test.function -p ${CMAKE_CURRENT_SOURCE_DIR}/suites/host_test.function -s ${CMAKE_CURRENT_SOURCE_DIR}/suites --help-file ${CMAKE_CURRENT_SOURCE_DIR}/suites/helpers.function -o .
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/scripts/generate_code.py mbedtls ${CMAKE_CURRENT_SOURCE_DIR}/suites/helpers.function ${CMAKE_CURRENT_SOURCE_DIR}/suites/main_test.function ${CMAKE_CURRENT_SOURCE_DIR}/suites/host_test.function ${CMAKE_CURRENT_SOURCE_DIR}/suites/test_suite_${suite_name}.function ${CMAKE_CURRENT_SOURCE_DIR}/suites/test_suite_${data_name}.data
)
include_directories(${CMAKE_CURRENT_SOURCE_DIR})

View File

@ -2,7 +2,7 @@
# To compile on SunOS: add "-lsocket -lnsl" to LDFLAGS
# To compile with PKCS11: add "-lpkcs11-helper" to LDFLAGS
CFLAGS ?= -g3 #-O2
CFLAGS ?= -O2
WARNING_CFLAGS ?= -Wall -W -Wdeclaration-after-statement -Wno-unused-function -Wno-unused-value
LDFLAGS ?=
@ -186,12 +186,12 @@ $(DEP):
C_FILES := $(addsuffix .c,$(APPS))
.SECONDEXPANSION:
$(C_FILES): %.c: suites/$$(func.$$*).function suites/%.data scripts/generate_code.py suites/helpers.function suites/main_test.function suites/desktop_test.function
$(C_FILES): %.c: suites/$$(func.$$*).function suites/%.data scripts/generate_code.py suites/helpers.function suites/main_test.function suites/host_test.function
echo " Gen $@"
python scripts/generate_code.py -f suites/$(func.$*).function \
-d suites/$*.data \
-t suites/main_test.function \
-p suites/desktop_test.function \
-p suites/host_test.function \
-s suites \
--help-file suites/helpers.function \
-o .
@ -218,20 +218,15 @@ test: check
# Create separate targets for generating embedded tests.
EMBEDDED_TESTS := $(addprefix embedded_,$(APPS))
# FIXME: description needs change
# Each test suite name is stripped off of prefix test_suite_. mbed-os test dir
# structure requires format TESTS/<testgroup>[/<sub testgroups..>]/<test case>
# Test app names are split on "." and end part is used as the test dir name.
# Prevous parts are used as the test group dirs. For tests without "." same
# name is used as the test group dir.
# Generate test code for target.
.SECONDEXPANSION:
$(EMBEDDED_TESTS): embedded_%: suites/$$(func.$$*).function suites/%.data scripts/generate_code.py suites/helpers.function suites/main_test.function suites/embedded_test.function
$(EMBEDDED_TESTS): embedded_%: suites/$$(func.$$*).function suites/%.data scripts/generate_code.py suites/helpers.function suites/main_test.function suites/target_test.function
echo " Gen ./TESTS/mbedtls/$*/$*.c"
python scripts/generate_code.py -f suites/$(func.$*).function \
-d suites/$*.data \
-t suites/main_test.function \
-p suites/embedded_test.function \
-p suites/target_test.function \
-s suites \
--help-file suites/helpers.function \
-o ./TESTS/mbedtls/$*

View File

@ -1,18 +1,22 @@
"""
mbed TLS
Copyright (c) 2017 ARM Limited
Test suites code generator.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
Copyright (C) 2006-2017, ARM Limited, All Rights Reserved
SPDX-License-Identifier: Apache-2.0
http://www.apache.org/licenses/LICENSE-2.0
Licensed under the Apache License, Version 2.0 (the "License"); you may
not use this file except in compliance with the License.
You may obtain a copy of the License at
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
This file is part of mbed TLS (https://tls.mbed.org)
"""
import os

View File

@ -1,18 +1,22 @@
"""
mbed SDK
Copyright (c) 2017 ARM Limited
Greentea host test script for on-target tests.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
Copyright (C) 2006-2017, ARM Limited, All Rights Reserved
SPDX-License-Identifier: Apache-2.0
http://www.apache.org/licenses/LICENSE-2.0
Licensed under the Apache License, Version 2.0 (the "License"); you may
not use this file except in compliance with the License.
You may obtain a copy of the License at
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
This file is part of mbed TLS (https://tls.mbed.org)
"""
import re

View File

@ -1,4 +1,4 @@
#line 2 "suites/desktop_test.function"
#line 2 "suites/host_test.function"
/**
* \brief Varifies that string is in string parameter format i.e. "<str>"

View File

@ -1,4 +1,4 @@
#line 2 "embedded_test.function"
#line 2 "suites/target_test.function"
#include "greentea-client/test_env.h"