mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-05 09:09:04 +08:00
add script to set copyright header for source files
this works for: - C/C++ files - files where comment is # Change include set of simple tests. Change-Id: I1c08c6c359e2a48957d5d81397c439508ae06c42 Signed-off-by: Artur Harasimiuk <artur.harasimiuk@intel.com>
This commit is contained in:
3
scripts/tests/copyright/in/file1.cpp
Normal file
3
scripts/tests/copyright/in/file1.cpp
Normal file
@@ -0,0 +1,3 @@
|
||||
/*
|
||||
* No copyright at all
|
||||
*/
|
||||
4
scripts/tests/copyright/in/file1.sh
Normal file
4
scripts/tests/copyright/in/file1.sh
Normal file
@@ -0,0 +1,4 @@
|
||||
#!/bin/bash
|
||||
|
||||
|
||||
echo 123
|
||||
4
scripts/tests/copyright/in/file2.cpp
Normal file
4
scripts/tests/copyright/in/file2.cpp
Normal file
@@ -0,0 +1,4 @@
|
||||
/*
|
||||
* Copyright (C) 2017 XYZ
|
||||
*/
|
||||
|
||||
2
scripts/tests/copyright/in/file2.sh
Normal file
2
scripts/tests/copyright/in/file2.sh
Normal file
@@ -0,0 +1,2 @@
|
||||
#
|
||||
# Copyright (C) 2017 XYZ
|
||||
3
scripts/tests/copyright/in/file3.cpp
Normal file
3
scripts/tests/copyright/in/file3.cpp
Normal file
@@ -0,0 +1,3 @@
|
||||
//
|
||||
// This comment shouldn't be removed
|
||||
//
|
||||
3
scripts/tests/copyright/in/file3.sh
Normal file
3
scripts/tests/copyright/in/file3.sh
Normal file
@@ -0,0 +1,3 @@
|
||||
#
|
||||
# This comment shouldn't be removed
|
||||
#
|
||||
7
scripts/tests/copyright/in/file4.cpp
Normal file
7
scripts/tests/copyright/in/file4.cpp
Normal file
@@ -0,0 +1,7 @@
|
||||
/*
|
||||
* No copyright at all
|
||||
*/
|
||||
|
||||
#include "file.h"
|
||||
|
||||
class C;
|
||||
7
scripts/tests/copyright/in/file4.sh
Normal file
7
scripts/tests/copyright/in/file4.sh
Normal file
@@ -0,0 +1,7 @@
|
||||
#
|
||||
# No copyright at all
|
||||
#
|
||||
|
||||
echo "file.h"
|
||||
|
||||
exit 1
|
||||
5
scripts/tests/copyright/in/file5.cpp
Normal file
5
scripts/tests/copyright/in/file5.cpp
Normal file
@@ -0,0 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2012 - 2016 Intel Corporation
|
||||
*
|
||||
* No spdx header
|
||||
*/
|
||||
10
scripts/tests/copyright/out/file1.cpp
Normal file
10
scripts/tests/copyright/out/file1.cpp
Normal file
@@ -0,0 +1,10 @@
|
||||
/*
|
||||
* Copyright (C) 2018 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* No copyright at all
|
||||
*/
|
||||
10
scripts/tests/copyright/out/file1.sh
Normal file
10
scripts/tests/copyright/out/file1.sh
Normal file
@@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Copyright (C) 2018 Intel Corporation
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
#
|
||||
|
||||
|
||||
|
||||
echo 123
|
||||
6
scripts/tests/copyright/out/file2.cpp
Normal file
6
scripts/tests/copyright/out/file2.cpp
Normal file
@@ -0,0 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2017-2018 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
5
scripts/tests/copyright/out/file2.sh
Normal file
5
scripts/tests/copyright/out/file2.sh
Normal file
@@ -0,0 +1,5 @@
|
||||
#
|
||||
# Copyright (C) 2017-2018 Intel Corporation
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
#
|
||||
10
scripts/tests/copyright/out/file3.cpp
Normal file
10
scripts/tests/copyright/out/file3.cpp
Normal file
@@ -0,0 +1,10 @@
|
||||
/*
|
||||
* Copyright (C) 2018 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
//
|
||||
// This comment shouldn't be removed
|
||||
//
|
||||
9
scripts/tests/copyright/out/file3.sh
Normal file
9
scripts/tests/copyright/out/file3.sh
Normal file
@@ -0,0 +1,9 @@
|
||||
#
|
||||
# Copyright (C) 2018 Intel Corporation
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
#
|
||||
|
||||
#
|
||||
# This comment shouldn't be removed
|
||||
#
|
||||
14
scripts/tests/copyright/out/file4.cpp
Normal file
14
scripts/tests/copyright/out/file4.cpp
Normal file
@@ -0,0 +1,14 @@
|
||||
/*
|
||||
* Copyright (C) 2018 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* No copyright at all
|
||||
*/
|
||||
|
||||
#include "file.h"
|
||||
|
||||
class C;
|
||||
13
scripts/tests/copyright/out/file4.sh
Normal file
13
scripts/tests/copyright/out/file4.sh
Normal file
@@ -0,0 +1,13 @@
|
||||
#
|
||||
# Copyright (C) 2018 Intel Corporation
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
#
|
||||
|
||||
#
|
||||
# No copyright at all
|
||||
#
|
||||
|
||||
echo "file.h"
|
||||
|
||||
exit 1
|
||||
6
scripts/tests/copyright/out/file5.cpp
Normal file
6
scripts/tests/copyright/out/file5.cpp
Normal file
@@ -0,0 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2012-2018 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
20
scripts/tests/copyright/test.sh
Executable file
20
scripts/tests/copyright/test.sh
Executable file
@@ -0,0 +1,20 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (C) 2018 Intel Corporation
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
#
|
||||
|
||||
#
|
||||
# Simple, file based tests for copyright script
|
||||
# script return non-zero error code if something went wrong.
|
||||
# diff output is printed
|
||||
#
|
||||
|
||||
python ../../lint/set_copyright.py in/*
|
||||
|
||||
for i in in/*
|
||||
do
|
||||
fn=$(basename $i)
|
||||
diff -du in/$fn out/$fn
|
||||
done
|
||||
Reference in New Issue
Block a user