Merge pull request #9736 from 0xc0170/fix_licenses_files

tools/test/cmsis: add license header
pull/9774/head
Martin Kojtal 2019-02-20 09:38:55 +01:00 committed by GitHub
commit 7f4475d924
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
26 changed files with 468 additions and 31 deletions

View File

@ -1,3 +1,20 @@
/*
* Copyright (c) 2016-2019 ARM Limited. All rights reserved.
*
* SPDX-License-Identifier: Apache-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
*
* 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.
*/
#include "mbed_toolchain.h" #include "mbed_toolchain.h"
#include <stdio.h> #include <stdio.h>

View File

@ -1,3 +1,20 @@
/*
* Copyright (c) 2016-2019 ARM Limited. All rights reserved.
*
* SPDX-License-Identifier: Apache-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
*
* 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.
*/
#include "mbed_toolchain.h" #include "mbed_toolchain.h"
int testWeak1() int testWeak1()

View File

@ -1,3 +1,20 @@
/*
* Copyright (c) 2015-2019 ARM Limited. All rights reserved.
*
* SPDX-License-Identifier: Apache-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
*
* 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.
*/
#include "mbed_assert.h" #include "mbed_assert.h"
#define THE_ANSWER 42 #define THE_ANSWER 42

View File

@ -1,3 +1,20 @@
/*
* Copyright (c) 2016-2019 ARM Limited. All rights reserved.
*
* SPDX-License-Identifier: Apache-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
*
* 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.
*/
#include "mbed_assert.h" #include "mbed_assert.h"
#define THE_ANSWER 42 #define THE_ANSWER 42

View File

@ -1,3 +1,19 @@
/*
* Copyright (c) 2018-2019, Arm Limited and affiliates.
* SPDX-License-Identifier: Apache-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
*
* 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.
*/
#ifndef WIFI_TESTS_H #ifndef WIFI_TESTS_H
#define WIFI_TESTS_H #define WIFI_TESTS_H

View File

@ -1,23 +1,18 @@
/* mbed Microcontroller Library /*
* Copyright (c) 2006-2012 ARM Limited * Copyright (c) 2018-2019, Arm Limited and affiliates.
* SPDX-License-Identifier: Apache-2.0
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy * Licensed under the Apache License, Version 2.0 (the "License");
* of this software and associated documentation files (the "Software"), to deal * you may not use this file except in compliance with the License.
* in the Software without restriction, including without limitation the rights * You may obtain a copy of the License at
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
* *
* The above copyright notice and this permission notice shall be included in * http://www.apache.org/licenses/LICENSE-2.0
* all copies or substantial portions of the Software.
* *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * Unless required by applicable law or agreed to in writing, software
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * distributed under the License is distributed on an "AS IS" BASIS,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * See the License for the specific language governing permissions and
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * limitations under the License.
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/ */
#ifndef MBED_CMSIS_CONF_H #ifndef MBED_CMSIS_CONF_H
#define MBED_CMSIS_CONF_H #define MBED_CMSIS_CONF_H

View File

@ -1,3 +1,21 @@
"""
Copyright (c) 2016-2019 ARM Limited. All rights reserved.
SPDX-License-Identifier: Apache-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
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.
"""
try: try:
from urllib2 import urlopen, URLError from urllib2 import urlopen, URLError
except ImportError: except ImportError:

View File

@ -1,3 +1,20 @@
"""
Copyright (c) 2016-2019 ARM Limited. All rights reserved.
SPDX-License-Identifier: Apache-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
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.
"""
from __future__ import print_function, division, absolute_import from __future__ import print_function, division, absolute_import
import argparse import argparse
from os.path import basename from os.path import basename

View File

@ -1,3 +1,21 @@
"""
Copyright (c) 2016-2019 ARM Limited. All rights reserved.
SPDX-License-Identifier: Apache-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
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.
"""
# Script to check a new mbed 2 release by compiling a set of specified test apps # Script to check a new mbed 2 release by compiling a set of specified test apps
# for all currently supported platforms. Each test app must include an mbed library. # for all currently supported platforms. Each test app must include an mbed library.
# This can either be the pre-compiled version 'mbed' or the source version 'mbed-dev'. # This can either be the pre-compiled version 'mbed' or the source version 'mbed-dev'.

View File

@ -1,3 +1,21 @@
"""
Copyright (c) 2014-2019 ARM Limited. All rights reserved.
SPDX-License-Identifier: Apache-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
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.
"""
from intelhex import IntelHex from intelhex import IntelHex
from cStringIO import StringIO from cStringIO import StringIO

View File

@ -1,4 +1,21 @@
"""Just a template for subclassing""" """
Copyright (c) 2016-2019 ARM Limited. All rights reserved.
SPDX-License-Identifier: Apache-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
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.
"""
import os import os
from abc import abstractmethod, ABCMeta from abc import abstractmethod, ABCMeta
import logging import logging
@ -12,6 +29,7 @@ from tools.targets import TARGET_MAP
from tools.utils import mkdir from tools.utils import mkdir
from tools.resources import FileType from tools.resources import FileType
"""Just a template for subclassing"""
class TargetNotSupportedException(Exception): class TargetNotSupportedException(Exception):
"""Indicates that an IDE does not support a particular MCU""" """Indicates that an IDE does not support a particular MCU"""

View File

@ -1,3 +1,21 @@
"""
Copyright (c) 2016 ARM Limited. All rights reserved.
SPDX-License-Identifier: Apache-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
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.
"""
from __future__ import print_function from __future__ import print_function
import sys import sys
import re import re

View File

@ -1,3 +1,21 @@
"""
Copyright (c) 2017-2019 ARM Limited. All rights reserved.
SPDX-License-Identifier: Apache-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
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.
"""
import os import os
import json import json
import sys import sys

View File

@ -1,6 +1,22 @@
#!/usr/bin/env python #!/usr/bin/env python
"""Memory Map File Analyser for ARM mbed""" """
Copyright (c) 2016-2019 ARM Limited. All rights reserved.
SPDX-License-Identifier: Apache-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
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.
"""
from __future__ import print_function, division, absolute_import from __future__ import print_function, division, absolute_import
from abc import abstractmethod, ABCMeta from abc import abstractmethod, ABCMeta

View File

@ -1,5 +1,23 @@
#!/usr/bin/env python #!/usr/bin/env python
"""
Copyright (c) 2016-2019 ARM Limited. All rights reserved.
SPDX-License-Identifier: Apache-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
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.
"""
import os import os
import re import re

View File

@ -1,3 +1,21 @@
"""
Copyright (c) 2016-2019 ARM Limited. All rights reserved.
SPDX-License-Identifier: Apache-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
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.
"""
import json import json
import os import os
import stat import stat

View File

@ -1,6 +1,21 @@
""" The CLI entry point for exporting projects from the mbed tools to any of the
supported IDEs or project structures.
""" """
Copyright (c) 2016-2019 ARM Limited. All rights reserved.
SPDX-License-Identifier: Apache-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
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
"""
from __future__ import print_function, absolute_import from __future__ import print_function, absolute_import
from builtins import str from builtins import str
@ -39,6 +54,10 @@ from tools.utils import NotSupportedException
from tools.options import extract_profile, list_profiles, extract_mcus from tools.options import extract_profile, list_profiles, extract_mcus
from tools.notifier.term import TerminalNotifier from tools.notifier.term import TerminalNotifier
""" The CLI entry point for exporting projects from the mbed tools to any of the
supported IDEs or project structures.
"""
EXPORTER_ALIASES = { EXPORTER_ALIASES = {
u'gcc_arm': u'make_gcc_arm', u'gcc_arm': u'make_gcc_arm',
u'uvision': u'uvision5', u'uvision': u'uvision5',

View File

@ -0,0 +1,17 @@
"""
Copyright (c) 2016-2019 ARM Limited. All rights reserved.
SPDX-License-Identifier: Apache-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
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
"""

View File

@ -1,4 +1,20 @@
""" import and bulid a bunch of example programs """ """
Copyright (c) 2017-2019 ARM Limited. All rights reserved.
SPDX-License-Identifier: Apache-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
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
"""
from argparse import ArgumentParser from argparse import ArgumentParser
import os import os
@ -8,6 +24,8 @@ import sys
import subprocess import subprocess
import json import json
""" import and bulid a bunch of example programs """
ROOT = abspath(dirname(dirname(dirname(dirname(__file__))))) ROOT = abspath(dirname(dirname(dirname(dirname(__file__)))))
sys.path.insert(0, ROOT) sys.path.insert(0, ROOT)

View File

@ -1,8 +1,19 @@
""" Import and bulid a bunch of example programs """
Copyright (c) 2017-2019 ARM Limited. All rights reserved.
This library includes functions that are shared between the examples.py and SPDX-License-Identifier: Apache-2.0
the update.py modules.
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
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
""" """
import os import os
from os.path import dirname, abspath, basename from os.path import dirname, abspath, basename
@ -11,6 +22,13 @@ import sys
import subprocess import subprocess
from shutil import rmtree from shutil import rmtree
""" Import and bulid a bunch of example programs
This library includes functions that are shared between the examples.py and
the update.py modules.
"""
ROOT = abspath(dirname(dirname(dirname(dirname(__file__))))) ROOT = abspath(dirname(dirname(dirname(dirname(__file__)))))
sys.path.insert(0, ROOT) sys.path.insert(0, ROOT)

View File

@ -1,3 +1,21 @@
"""
Copyright (c) 2018-2019 ARM Limited. All rights reserved.
SPDX-License-Identifier: Apache-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
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
"""
import sys import sys
from io import open from io import open
from os import sep from os import sep

View File

@ -1,9 +1,27 @@
"""A test that all code scores above a 9.25 in pylint""" """
Copyright (c) 2016-2019 ARM Limited. All rights reserved.
SPDX-License-Identifier: Apache-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
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
"""
import subprocess import subprocess
import re import re
import os.path import os.path
"""A test that all code scores above a 9.25 in pylint"""
SCORE_REGEXP = re.compile( SCORE_REGEXP = re.compile(
r'^Your\ code\ has\ been\ rated\ at\ (\-?[0-9\.]+)/10') r'^Your\ code\ has\ been\ rated\ at\ (\-?[0-9\.]+)/10')

View File

@ -0,0 +1,17 @@
"""
Copyright (c) 2019 ARM Limited. All rights reserved.
SPDX-License-Identifier: Apache-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
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
"""

View File

@ -1,4 +1,21 @@
"""Tests for the toolchain sub-system""" """
Copyright (c) 2017-2019 ARM Limited. All rights reserved.
SPDX-License-Identifier: Apache-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
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
"""
import sys import sys
import os import os
from string import printable from string import printable
@ -7,6 +24,8 @@ from mock import MagicMock, patch
from hypothesis import given, settings, HealthCheck from hypothesis import given, settings, HealthCheck
from hypothesis.strategies import text, lists, fixed_dictionaries, booleans from hypothesis.strategies import text, lists, fixed_dictionaries, booleans
"""Tests for the toolchain sub-system"""
ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..", ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..",
"..")) ".."))
sys.path.insert(0, ROOT) sys.path.insert(0, ROOT)

View File

@ -1,4 +1,21 @@
"""Tests for the arm toolchain supported checks""" """
Copyright (c) 2016-2019 ARM Limited. All rights reserved.
SPDX-License-Identifier: Apache-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
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
"""
import sys import sys
import os import os
from string import printable from string import printable
@ -7,6 +24,8 @@ from mock import MagicMock, patch
from hypothesis import given, settings from hypothesis import given, settings
from hypothesis.strategies import text, lists, sampled_from from hypothesis.strategies import text, lists, sampled_from
"""Tests for the arm toolchain supported checks"""
ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..", ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..",
"..")) ".."))
sys.path.insert(0, ROOT) sys.path.insert(0, ROOT)

View File

@ -1,3 +1,21 @@
"""
Copyright (c) 2018-2019 ARM Limited. All rights reserved.
SPDX-License-Identifier: Apache-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
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
"""
from os.path import dirname, abspath, join, exists from os.path import dirname, abspath, join, exists
from tools.utils import json_file_to_dict from tools.utils import json_file_to_dict