Add Apache-2.0 headers to all source files
Also normalize the first line of the copyright headers.
This commit was generated using the following script:
# ========================
#!/bin/sh
# Find scripts
find -path './.git' -prune -o '(' -name '*.c' -o -name '*.cpp' -o -name '*.fmt' -o -name '*.h' ')' -print | xargs sed -i '
# Normalize the first line of the copyright headers (no text on the first line of a block comment)
/^\/\*.*Copyright.*Arm/I {
i\
/*
s/^\// /
}
/Copyright.*Arm/I {
# Print copyright declaration
p
# Read the two lines immediately following the copyright declaration
N
N
# Insert Apache header if it is missing
/SPDX/! i\
* 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.
# Clear copyright declaration from buffer
D
}
'
# ========================
Signed-off-by: Bence Szépkúti <bence.szepkuti@arm.com>
diff --git a/tests/include/test/helpers.h b/tests/include/test/helpers.h
index 36b9e72..36ec8e6 100644
--- a/tests/include/test/helpers.h
+++ b/tests/include/test/helpers.h
@@ -5,7 +5,8 @@
* purpose of testing.
*/
-/* Copyright (C) 2020, ARM Limited, All Rights Reserved
+/*
+ * Copyright (C) 2020, ARM Limited, All Rights Reserved
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
diff --git a/tests/include/test/macros.h b/tests/include/test/macros.h
index 25f8312..aaf13ad 100644
--- a/tests/include/test/macros.h
+++ b/tests/include/test/macros.h
@@ -4,7 +4,8 @@
* \brief This file contains generic macros for the purpose of testing.
*/
-/* Copyright (C) 2020, ARM Limited, All Rights Reserved
+/*
+ * Copyright (C) 2020, ARM Limited, All Rights Reserved
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
diff --git a/tests/include/test/psa_crypto_helpers.h b/tests/include/test/psa_crypto_helpers.h
index 1dd6084..8cd361f 100644
--- a/tests/include/test/psa_crypto_helpers.h
+++ b/tests/include/test/psa_crypto_helpers.h
@@ -1,7 +1,8 @@
/*
* Helper functions for tests that use the PSA Crypto API.
*/
-/* Copyright (C) 2019, ARM Limited, All Rights Reserved
+/*
+ * 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
diff --git a/tests/include/test/psa_helpers.h b/tests/include/test/psa_helpers.h
index 79f6837..352ae67 100644
--- a/tests/include/test/psa_helpers.h
+++ b/tests/include/test/psa_helpers.h
@@ -1,7 +1,8 @@
/*
* Helper functions for tests that use any PSA API.
*/
-/* Copyright (C) 2019, ARM Limited, All Rights Reserved
+/*
+ * 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
diff --git a/tests/include/test/random.h b/tests/include/test/random.h
index dfdefa6..e085f16 100644
--- a/tests/include/test/random.h
+++ b/tests/include/test/random.h
@@ -5,7 +5,8 @@
* random numbers for the purpose of testing.
*/
-/* Copyright (C) 2020, ARM Limited, All Rights Reserved
+/*
+ * Copyright (C) 2020, ARM Limited, All Rights Reserved
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
diff --git a/tests/src/helpers.c b/tests/src/helpers.c
index f0c27c3..08d88a5 100644
--- a/tests/src/helpers.c
+++ b/tests/src/helpers.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 2020, ARM Limited, All Rights Reserved
+/*
+ * Copyright (C) 2020, ARM Limited, All Rights Reserved
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
diff --git a/tests/src/random.c b/tests/src/random.c
index 25fa4cf..3345f78 100644
--- a/tests/src/random.c
+++ b/tests/src/random.c
@@ -5,7 +5,8 @@
* for the purpose of testing.
*/
-/* Copyright (C) 2020, ARM Limited, All Rights Reserved
+/*
+ * Copyright (C) 2020, ARM Limited, All Rights Reserved
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may