From 0839207a27c1b55141496e537437dd87c9a160a4 Mon Sep 17 00:00:00 2001 From: Arkadiusz Szczepkowicz Date: Fri, 31 May 2024 16:08:49 +0200 Subject: [PATCH 1/6] #341: Add check_licence bash script --- scripts/add-license-perl.pl | 2 +- scripts/check_license.sh | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100755 scripts/check_license.sh diff --git a/scripts/add-license-perl.pl b/scripts/add-license-perl.pl index 9cf7aa8c..1aa082ba 100755 --- a/scripts/add-license-perl.pl +++ b/scripts/add-license-perl.pl @@ -5,7 +5,7 @@ use strict; use warnings; -my ($path, $template, $extension) = ($ARGV[0], "license-template", "*.*"); +my ($path, $template, $extension) = ($ARGV[0], "license-template", ["*.h", "*.cc"]); $template = $ARGV[1] if (@ARGV > 1); $extension = $ARGV[2] if (@ARGV > 2); diff --git a/scripts/check_license.sh b/scripts/check_license.sh new file mode 100755 index 00000000..109c477b --- /dev/null +++ b/scripts/check_license.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +path_to_magistrate=${1} +cd "$path_to_magistrate" || exit 1 + +for sub_dir in "src" "tests" "examples" +do + "$path_to_magistrate/scripts/add-license-perl.pl" "$path_to_magistrate/$sub_dir" "$path_to_magistrate/scripts/license-template" +done + +result=$(git diff --name-only) + +if [ -n "$result" ]; then + echo -e "Following files have incorrect license!\n" + echo "$result" + exit 1 +fi From 8dd5a65cb27562ffc1ea06a89e9a8f37eda1a635 Mon Sep 17 00:00:00 2001 From: Arkadiusz Szczepkowicz Date: Fri, 31 May 2024 16:13:01 +0200 Subject: [PATCH 2/6] #341: Fix incorrect licenses --- examples/checkpoint_example_1_nonintrusive.cc | 2 +- examples/checkpoint_example_2_nonintrusive.cc | 2 +- examples/checkpoint_example_3_nonintrusive.cc | 2 +- examples/checkpoint_example_polymorphic.cc | 2 +- examples/checkpoint_example_polymorphic_macro.cc | 2 +- examples/checkpoint_example_polymorphic_macro_nonintrusive.cc | 2 +- examples/checkpoint_example_polymorphic_nonintrusive.cc | 2 +- examples/checkpoint_example_to_file.cc | 2 +- examples/checkpoint_example_to_file_nonintrusive.cc | 2 +- examples/checkpoint_example_traversal.cc | 2 +- examples/checkpoint_example_traversal_nonintrusive.cc | 2 +- src/checkpoint/container/atomic_serialize.h | 4 ++-- src/checkpoint/container/chrono_serialize.h | 4 ++-- src/checkpoint/container/function_serialize.h | 4 ++-- src/checkpoint/container/kokkos_complex_serialize.h | 2 +- src/checkpoint/container/kokkos_pair_serialize.h | 2 +- src/checkpoint/container/kokkos_unordered_map_serialize.h | 2 +- src/checkpoint/container/queue_serialize.h | 4 ++-- src/checkpoint/container/raw_ptr_serialize.h | 2 +- src/checkpoint/container/shared_ptr_serialize.h | 4 ++-- src/checkpoint/container/thread_serialize.h | 4 ++-- src/checkpoint/container/variant_serialize.h | 2 +- src/checkpoint/detector.h | 2 +- src/checkpoint/dispatch/allocator.h | 3 +-- src/checkpoint/dispatch/type_registry.h | 2 +- src/checkpoint/serializers/footprinter.h | 2 +- src/checkpoint/traits/reconstructor_traits.h | 3 +-- tests/unit/test_kokkos_serialize_3d_left.cc | 2 +- tests/unit/test_kokkos_serialize_3d_right.cc | 2 +- tests/unit/test_kokkos_serialize_3d_stride.cc | 2 +- tests/unit/test_kokkos_serialize_complex.cc | 2 +- tests/unit/test_kokkos_serialize_dynrankview.cc | 2 +- tests/unit/test_kokkos_serialize_pair.cc | 2 +- tests/unit/test_kokkos_serialize_special.cc | 2 +- tests/unit/test_kokkos_serialize_unordered_map.cc | 2 +- tests/unit/test_serialization_error_checking.cc | 2 +- tests/unit/test_serialize_file.cc | 2 +- tests/unit/test_tagged_construct.cc | 2 +- tests/unit/test_unique_ptr.cc | 2 +- tests/unit/test_variant_serializer.cc | 3 +-- tests/unit/test_vector_bool_serialize.cc | 2 +- tests/unit/test_vector_serializer.cc | 3 +-- tests/unit/tests_mpi/test_kokkos_serialize_2d_mpi_left.cc | 2 +- tests/unit/tests_mpi/test_kokkos_serialize_2d_mpi_right.cc | 2 +- tests/unit/tests_mpi/test_kokkos_serialize_2d_mpi_stride.cc | 2 +- tests/unit/tests_mpi/test_kokkos_serialize_3d_mpi_left.cc | 2 +- tests/unit/tests_mpi/test_kokkos_serialize_3d_mpi_right.cc | 2 +- tests/unit/tests_mpi/test_kokkos_serialize_3d_mpi_stride.cc | 2 +- 48 files changed, 54 insertions(+), 58 deletions(-) diff --git a/examples/checkpoint_example_1_nonintrusive.cc b/examples/checkpoint_example_1_nonintrusive.cc index ee17a761..06e3a5ee 100644 --- a/examples/checkpoint_example_1_nonintrusive.cc +++ b/examples/checkpoint_example_1_nonintrusive.cc @@ -2,7 +2,7 @@ //@HEADER // ***************************************************************************** // -// checkpoint_example_1_nonintrusive.cc +// checkpoint_example_1_nonintrusive.cc // DARMA/checkpoint => Serialization Library // // Copyright 2019 National Technology & Engineering Solutions of Sandia, LLC diff --git a/examples/checkpoint_example_2_nonintrusive.cc b/examples/checkpoint_example_2_nonintrusive.cc index 174caa1d..b11b53ae 100644 --- a/examples/checkpoint_example_2_nonintrusive.cc +++ b/examples/checkpoint_example_2_nonintrusive.cc @@ -2,7 +2,7 @@ //@HEADER // ***************************************************************************** // -// checkpoint_example_2_nonintrusive.cc +// checkpoint_example_2_nonintrusive.cc // DARMA/checkpoint => Serialization Library // // Copyright 2019 National Technology & Engineering Solutions of Sandia, LLC diff --git a/examples/checkpoint_example_3_nonintrusive.cc b/examples/checkpoint_example_3_nonintrusive.cc index ed090151..47a8373d 100644 --- a/examples/checkpoint_example_3_nonintrusive.cc +++ b/examples/checkpoint_example_3_nonintrusive.cc @@ -2,7 +2,7 @@ //@HEADER // ***************************************************************************** // -// checkpoint_example_3_nonintrusive.cc +// checkpoint_example_3_nonintrusive.cc // DARMA/checkpoint => Serialization Library // // Copyright 2019 National Technology & Engineering Solutions of Sandia, LLC diff --git a/examples/checkpoint_example_polymorphic.cc b/examples/checkpoint_example_polymorphic.cc index 1b589573..e78ca0bc 100644 --- a/examples/checkpoint_example_polymorphic.cc +++ b/examples/checkpoint_example_polymorphic.cc @@ -2,7 +2,7 @@ //@HEADER // ***************************************************************************** // -// checkpoint_example_polymorphic.cc +// checkpoint_example_polymorphic.cc // DARMA/checkpoint => Serialization Library // // Copyright 2019 National Technology & Engineering Solutions of Sandia, LLC diff --git a/examples/checkpoint_example_polymorphic_macro.cc b/examples/checkpoint_example_polymorphic_macro.cc index 5f0170c9..a4167701 100644 --- a/examples/checkpoint_example_polymorphic_macro.cc +++ b/examples/checkpoint_example_polymorphic_macro.cc @@ -2,7 +2,7 @@ //@HEADER // ***************************************************************************** // -// checkpoint_example_polymorphic_macro.cc +// checkpoint_example_polymorphic_macro.cc // DARMA/checkpoint => Serialization Library // // Copyright 2019 National Technology & Engineering Solutions of Sandia, LLC diff --git a/examples/checkpoint_example_polymorphic_macro_nonintrusive.cc b/examples/checkpoint_example_polymorphic_macro_nonintrusive.cc index 6708c2ac..9bbaca4e 100644 --- a/examples/checkpoint_example_polymorphic_macro_nonintrusive.cc +++ b/examples/checkpoint_example_polymorphic_macro_nonintrusive.cc @@ -2,7 +2,7 @@ //@HEADER // ***************************************************************************** // -// checkpoint_example_polymorphic_macro_nonintrusive.cc +// checkpoint_example_polymorphic_macro_nonintrusive.cc // DARMA/checkpoint => Serialization Library // // Copyright 2019 National Technology & Engineering Solutions of Sandia, LLC diff --git a/examples/checkpoint_example_polymorphic_nonintrusive.cc b/examples/checkpoint_example_polymorphic_nonintrusive.cc index 76f136bc..e9ff345a 100644 --- a/examples/checkpoint_example_polymorphic_nonintrusive.cc +++ b/examples/checkpoint_example_polymorphic_nonintrusive.cc @@ -2,7 +2,7 @@ //@HEADER // ***************************************************************************** // -// checkpoint_example_polymorphic_nonintrusive.cc +// checkpoint_example_polymorphic_nonintrusive.cc // DARMA/checkpoint => Serialization Library // // Copyright 2019 National Technology & Engineering Solutions of Sandia, LLC diff --git a/examples/checkpoint_example_to_file.cc b/examples/checkpoint_example_to_file.cc index c370a6fc..342f7a22 100644 --- a/examples/checkpoint_example_to_file.cc +++ b/examples/checkpoint_example_to_file.cc @@ -2,7 +2,7 @@ //@HEADER // ***************************************************************************** // -// checkpoint_example_to_file.cc +// checkpoint_example_to_file.cc // DARMA/checkpoint => Serialization Library // // Copyright 2019 National Technology & Engineering Solutions of Sandia, LLC diff --git a/examples/checkpoint_example_to_file_nonintrusive.cc b/examples/checkpoint_example_to_file_nonintrusive.cc index aaa9412e..7deba9b9 100644 --- a/examples/checkpoint_example_to_file_nonintrusive.cc +++ b/examples/checkpoint_example_to_file_nonintrusive.cc @@ -2,7 +2,7 @@ //@HEADER // ***************************************************************************** // -// checkpoint_example_to_file_nonintrusive.cc +// checkpoint_example_to_file_nonintrusive.cc // DARMA/checkpoint => Serialization Library // // Copyright 2019 National Technology & Engineering Solutions of Sandia, LLC diff --git a/examples/checkpoint_example_traversal.cc b/examples/checkpoint_example_traversal.cc index b180783c..2e69f592 100644 --- a/examples/checkpoint_example_traversal.cc +++ b/examples/checkpoint_example_traversal.cc @@ -2,7 +2,7 @@ //@HEADER // ***************************************************************************** // -// checkpoint_traversal.cc +// checkpoint_example_traversal.cc // DARMA/checkpoint => Serialization Library // // Copyright 2019 National Technology & Engineering Solutions of Sandia, LLC diff --git a/examples/checkpoint_example_traversal_nonintrusive.cc b/examples/checkpoint_example_traversal_nonintrusive.cc index caa4dca8..e0740970 100644 --- a/examples/checkpoint_example_traversal_nonintrusive.cc +++ b/examples/checkpoint_example_traversal_nonintrusive.cc @@ -2,7 +2,7 @@ //@HEADER // ***************************************************************************** // -// checkpoint_traversal_nonintrusive.cc +// checkpoint_example_traversal_nonintrusive.cc // DARMA/checkpoint => Serialization Library // // Copyright 2019 National Technology & Engineering Solutions of Sandia, LLC diff --git a/src/checkpoint/container/atomic_serialize.h b/src/checkpoint/container/atomic_serialize.h index b639712d..098ee91b 100644 --- a/src/checkpoint/container/atomic_serialize.h +++ b/src/checkpoint/container/atomic_serialize.h @@ -2,10 +2,10 @@ //@HEADER // ***************************************************************************** // -// atomic_serialize.h +// atomic_serialize.h // DARMA/checkpoint => Serialization Library // -// Copyright 2020 National Technology & Engineering Solutions of Sandia, LLC +// Copyright 2019 National Technology & Engineering Solutions of Sandia, LLC // (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the U.S. // Government retains certain rights in this software. // diff --git a/src/checkpoint/container/chrono_serialize.h b/src/checkpoint/container/chrono_serialize.h index 3eacb0fc..7c41e3a9 100644 --- a/src/checkpoint/container/chrono_serialize.h +++ b/src/checkpoint/container/chrono_serialize.h @@ -2,10 +2,10 @@ //@HEADER // ***************************************************************************** // -// chrono_serialize.h +// chrono_serialize.h // DARMA/checkpoint => Serialization Library // -// Copyright 2020 National Technology & Engineering Solutions of Sandia, LLC +// Copyright 2019 National Technology & Engineering Solutions of Sandia, LLC // (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the U.S. // Government retains certain rights in this software. // diff --git a/src/checkpoint/container/function_serialize.h b/src/checkpoint/container/function_serialize.h index aac19ab5..7dd4d77d 100644 --- a/src/checkpoint/container/function_serialize.h +++ b/src/checkpoint/container/function_serialize.h @@ -2,10 +2,10 @@ //@HEADER // ***************************************************************************** // -// function_serialize.h +// function_serialize.h // DARMA/checkpoint => Serialization Library // -// Copyright 2020 National Technology & Engineering Solutions of Sandia, LLC +// Copyright 2019 National Technology & Engineering Solutions of Sandia, LLC // (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the U.S. // Government retains certain rights in this software. // diff --git a/src/checkpoint/container/kokkos_complex_serialize.h b/src/checkpoint/container/kokkos_complex_serialize.h index 33789fd6..7355e556 100644 --- a/src/checkpoint/container/kokkos_complex_serialize.h +++ b/src/checkpoint/container/kokkos_complex_serialize.h @@ -2,7 +2,7 @@ //@HEADER // ***************************************************************************** // -// kokkos_complex_serialize.h +// kokkos_complex_serialize.h // DARMA/checkpoint => Serialization Library // // Copyright 2019 National Technology & Engineering Solutions of Sandia, LLC diff --git a/src/checkpoint/container/kokkos_pair_serialize.h b/src/checkpoint/container/kokkos_pair_serialize.h index 3d07096d..892e08a2 100644 --- a/src/checkpoint/container/kokkos_pair_serialize.h +++ b/src/checkpoint/container/kokkos_pair_serialize.h @@ -2,7 +2,7 @@ //@HEADER // ***************************************************************************** // -// kokkos_pair_serialize.h +// kokkos_pair_serialize.h // DARMA/checkpoint => Serialization Library // // Copyright 2019 National Technology & Engineering Solutions of Sandia, LLC diff --git a/src/checkpoint/container/kokkos_unordered_map_serialize.h b/src/checkpoint/container/kokkos_unordered_map_serialize.h index 6d230872..1b5de430 100644 --- a/src/checkpoint/container/kokkos_unordered_map_serialize.h +++ b/src/checkpoint/container/kokkos_unordered_map_serialize.h @@ -2,7 +2,7 @@ //@HEADER // ***************************************************************************** // -// kokkos_unordered_map_serialize.h +// kokkos_unordered_map_serialize.h // DARMA/checkpoint => Serialization Library // // Copyright 2019 National Technology & Engineering Solutions of Sandia, LLC diff --git a/src/checkpoint/container/queue_serialize.h b/src/checkpoint/container/queue_serialize.h index 0ac6573e..e90b79fb 100644 --- a/src/checkpoint/container/queue_serialize.h +++ b/src/checkpoint/container/queue_serialize.h @@ -2,10 +2,10 @@ //@HEADER // ***************************************************************************** // -// queue_serialize.h +// queue_serialize.h // DARMA/checkpoint => Serialization Library // -// Copyright 2020 National Technology & Engineering Solutions of Sandia, LLC +// Copyright 2019 National Technology & Engineering Solutions of Sandia, LLC // (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the U.S. // Government retains certain rights in this software. // diff --git a/src/checkpoint/container/raw_ptr_serialize.h b/src/checkpoint/container/raw_ptr_serialize.h index be83cfb5..d8887efa 100644 --- a/src/checkpoint/container/raw_ptr_serialize.h +++ b/src/checkpoint/container/raw_ptr_serialize.h @@ -5,7 +5,7 @@ // raw_ptr_serialize.h // DARMA/checkpoint => Serialization Library // -// Copyright 2020 National Technology & Engineering Solutions of Sandia, LLC +// Copyright 2019 National Technology & Engineering Solutions of Sandia, LLC // (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the U.S. // Government retains certain rights in this software. // diff --git a/src/checkpoint/container/shared_ptr_serialize.h b/src/checkpoint/container/shared_ptr_serialize.h index a2554f02..afe70de0 100644 --- a/src/checkpoint/container/shared_ptr_serialize.h +++ b/src/checkpoint/container/shared_ptr_serialize.h @@ -2,10 +2,10 @@ //@HEADER // ***************************************************************************** // -// shared_ptr_serialize.h +// shared_ptr_serialize.h // DARMA/checkpoint => Serialization Library // -// Copyright 2020 National Technology & Engineering Solutions of Sandia, LLC +// Copyright 2019 National Technology & Engineering Solutions of Sandia, LLC // (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the U.S. // Government retains certain rights in this software. // diff --git a/src/checkpoint/container/thread_serialize.h b/src/checkpoint/container/thread_serialize.h index 5ecefc85..19510e86 100644 --- a/src/checkpoint/container/thread_serialize.h +++ b/src/checkpoint/container/thread_serialize.h @@ -2,10 +2,10 @@ //@HEADER // ***************************************************************************** // -// thread_serialize.h +// thread_serialize.h // DARMA/checkpoint => Serialization Library // -// Copyright 2020 National Technology & Engineering Solutions of Sandia, LLC +// Copyright 2019 National Technology & Engineering Solutions of Sandia, LLC // (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the U.S. // Government retains certain rights in this software. // diff --git a/src/checkpoint/container/variant_serialize.h b/src/checkpoint/container/variant_serialize.h index ddabdd46..1b0f09af 100644 --- a/src/checkpoint/container/variant_serialize.h +++ b/src/checkpoint/container/variant_serialize.h @@ -2,7 +2,7 @@ //@HEADER // ***************************************************************************** // -// varaint_serialize.h +// variant_serialize.h // DARMA/checkpoint => Serialization Library // // Copyright 2019 National Technology & Engineering Solutions of Sandia, LLC diff --git a/src/checkpoint/detector.h b/src/checkpoint/detector.h index 52172b7d..128c651f 100644 --- a/src/checkpoint/detector.h +++ b/src/checkpoint/detector.h @@ -2,7 +2,7 @@ //@HEADER // ***************************************************************************** // -// detector.h +// detector.h // DARMA/checkpoint => Serialization Library // // Copyright 2019 National Technology & Engineering Solutions of Sandia, LLC diff --git a/src/checkpoint/dispatch/allocator.h b/src/checkpoint/dispatch/allocator.h index d9e62137..22922687 100644 --- a/src/checkpoint/dispatch/allocator.h +++ b/src/checkpoint/dispatch/allocator.h @@ -2,8 +2,7 @@ //@HEADER // ***************************************************************************** // -// allocator.h -// DARMA Toolkit v. 1.0.0 +// allocator.h // DARMA/checkpoint => Serialization Library // // Copyright 2019 National Technology & Engineering Solutions of Sandia, LLC diff --git a/src/checkpoint/dispatch/type_registry.h b/src/checkpoint/dispatch/type_registry.h index ad5de2c1..111eb86f 100644 --- a/src/checkpoint/dispatch/type_registry.h +++ b/src/checkpoint/dispatch/type_registry.h @@ -2,7 +2,7 @@ //@HEADER // ***************************************************************************** // -// type_registry.h +// type_registry.h // DARMA/checkpoint => Serialization Library // // Copyright 2019 National Technology & Engineering Solutions of Sandia, LLC diff --git a/src/checkpoint/serializers/footprinter.h b/src/checkpoint/serializers/footprinter.h index 7da018f5..0e315bd4 100644 --- a/src/checkpoint/serializers/footprinter.h +++ b/src/checkpoint/serializers/footprinter.h @@ -5,7 +5,7 @@ // footprinter.h // DARMA/checkpoint => Serialization Library // -// Copyright 2020 National Technology & Engineering Solutions of Sandia, LLC +// Copyright 2019 National Technology & Engineering Solutions of Sandia, LLC // (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the U.S. // Government retains certain rights in this software. // diff --git a/src/checkpoint/traits/reconstructor_traits.h b/src/checkpoint/traits/reconstructor_traits.h index 16fbd04c..5ccd2d29 100644 --- a/src/checkpoint/traits/reconstructor_traits.h +++ b/src/checkpoint/traits/reconstructor_traits.h @@ -2,8 +2,7 @@ //@HEADER // ***************************************************************************** // -// reconstructor_traits.h -// DARMA Toolkit v. 1.0.0 +// reconstructor_traits.h // DARMA/checkpoint => Serialization Library // // Copyright 2019 National Technology & Engineering Solutions of Sandia, LLC diff --git a/tests/unit/test_kokkos_serialize_3d_left.cc b/tests/unit/test_kokkos_serialize_3d_left.cc index dcd8a3a9..3ca6d83d 100644 --- a/tests/unit/test_kokkos_serialize_3d_left.cc +++ b/tests/unit/test_kokkos_serialize_3d_left.cc @@ -2,7 +2,7 @@ //@HEADER // ***************************************************************************** // -// test_kokkos_serialize_3d_left.cc +// test_kokkos_serialize_3d_left.cc // DARMA/checkpoint => Serialization Library // // Copyright 2019 National Technology & Engineering Solutions of Sandia, LLC diff --git a/tests/unit/test_kokkos_serialize_3d_right.cc b/tests/unit/test_kokkos_serialize_3d_right.cc index 4589ea46..3a57a536 100644 --- a/tests/unit/test_kokkos_serialize_3d_right.cc +++ b/tests/unit/test_kokkos_serialize_3d_right.cc @@ -2,7 +2,7 @@ //@HEADER // ***************************************************************************** // -// test_kokkos_serialize_3d_right.cc +// test_kokkos_serialize_3d_right.cc // DARMA/checkpoint => Serialization Library // // Copyright 2019 National Technology & Engineering Solutions of Sandia, LLC diff --git a/tests/unit/test_kokkos_serialize_3d_stride.cc b/tests/unit/test_kokkos_serialize_3d_stride.cc index 44e76dca..7a2fa1e9 100644 --- a/tests/unit/test_kokkos_serialize_3d_stride.cc +++ b/tests/unit/test_kokkos_serialize_3d_stride.cc @@ -2,7 +2,7 @@ //@HEADER // ***************************************************************************** // -// test_kokkos_serialize_3d_stride.cc +// test_kokkos_serialize_3d_stride.cc // DARMA/checkpoint => Serialization Library // // Copyright 2019 National Technology & Engineering Solutions of Sandia, LLC diff --git a/tests/unit/test_kokkos_serialize_complex.cc b/tests/unit/test_kokkos_serialize_complex.cc index 62817dd9..f3b5e79d 100644 --- a/tests/unit/test_kokkos_serialize_complex.cc +++ b/tests/unit/test_kokkos_serialize_complex.cc @@ -2,7 +2,7 @@ //@HEADER // ***************************************************************************** // -// test_kokkos_serialize_complex.cc +// test_kokkos_serialize_complex.cc // DARMA/checkpoint => Serialization Library // // Copyright 2019 National Technology & Engineering Solutions of Sandia, LLC diff --git a/tests/unit/test_kokkos_serialize_dynrankview.cc b/tests/unit/test_kokkos_serialize_dynrankview.cc index 520b3c81..86ee0285 100644 --- a/tests/unit/test_kokkos_serialize_dynrankview.cc +++ b/tests/unit/test_kokkos_serialize_dynrankview.cc @@ -2,7 +2,7 @@ //@HEADER // ***************************************************************************** // -// test_kokkos_serialize_dynrankview.cc +// test_kokkos_serialize_dynrankview.cc // DARMA/checkpoint => Serialization Library // // Copyright 2019 National Technology & Engineering Solutions of Sandia, LLC diff --git a/tests/unit/test_kokkos_serialize_pair.cc b/tests/unit/test_kokkos_serialize_pair.cc index 5e4184db..8b243d17 100644 --- a/tests/unit/test_kokkos_serialize_pair.cc +++ b/tests/unit/test_kokkos_serialize_pair.cc @@ -2,7 +2,7 @@ //@HEADER // ***************************************************************************** // -// test_kokkos_serialize_pair.cc +// test_kokkos_serialize_pair.cc // DARMA/checkpoint => Serialization Library // // Copyright 2019 National Technology & Engineering Solutions of Sandia, LLC diff --git a/tests/unit/test_kokkos_serialize_special.cc b/tests/unit/test_kokkos_serialize_special.cc index a23202ec..5d1f4303 100644 --- a/tests/unit/test_kokkos_serialize_special.cc +++ b/tests/unit/test_kokkos_serialize_special.cc @@ -2,7 +2,7 @@ //@HEADER // ***************************************************************************** // -// test_kokkos_serialize_special.cc +// test_kokkos_serialize_special.cc // DARMA/checkpoint => Serialization Library // // Copyright 2019 National Technology & Engineering Solutions of Sandia, LLC diff --git a/tests/unit/test_kokkos_serialize_unordered_map.cc b/tests/unit/test_kokkos_serialize_unordered_map.cc index 055d76c9..60fb8aff 100644 --- a/tests/unit/test_kokkos_serialize_unordered_map.cc +++ b/tests/unit/test_kokkos_serialize_unordered_map.cc @@ -2,7 +2,7 @@ //@HEADER // ***************************************************************************** // -// test_kokkos_serialize_unordered_map.cc +// test_kokkos_serialize_unordered_map.cc // DARMA/checkpoint => Serialization Library // // Copyright 2019 National Technology & Engineering Solutions of Sandia, LLC diff --git a/tests/unit/test_serialization_error_checking.cc b/tests/unit/test_serialization_error_checking.cc index abd3a352..b759a5b6 100644 --- a/tests/unit/test_serialization_error_checking.cc +++ b/tests/unit/test_serialization_error_checking.cc @@ -2,7 +2,7 @@ //@HEADER // ***************************************************************************** // -// test_serialization_error_checking.cc +// test_serialization_error_checking.cc // DARMA/checkpoint => Serialization Library // // Copyright 2019 National Technology & Engineering Solutions of Sandia, LLC diff --git a/tests/unit/test_serialize_file.cc b/tests/unit/test_serialize_file.cc index 8ab3b1d2..3ad56106 100644 --- a/tests/unit/test_serialize_file.cc +++ b/tests/unit/test_serialize_file.cc @@ -2,7 +2,7 @@ //@HEADER // ***************************************************************************** // -// test_serialize_file.cc +// test_serialize_file.cc // DARMA/checkpoint => Serialization Library // // Copyright 2019 National Technology & Engineering Solutions of Sandia, LLC diff --git a/tests/unit/test_tagged_construct.cc b/tests/unit/test_tagged_construct.cc index ae04bc8d..daefc916 100644 --- a/tests/unit/test_tagged_construct.cc +++ b/tests/unit/test_tagged_construct.cc @@ -2,7 +2,7 @@ //@HEADER // ***************************************************************************** // -// test_tagged_construct.cc +// test_tagged_construct.cc // DARMA/checkpoint => Serialization Library // // Copyright 2019 National Technology & Engineering Solutions of Sandia, LLC diff --git a/tests/unit/test_unique_ptr.cc b/tests/unit/test_unique_ptr.cc index 7862c868..143d8a47 100644 --- a/tests/unit/test_unique_ptr.cc +++ b/tests/unit/test_unique_ptr.cc @@ -2,7 +2,7 @@ //@HEADER // ***************************************************************************** // -// test_unique_ptr.cc +// test_unique_ptr.cc // DARMA/checkpoint => Serialization Library // // Copyright 2019 National Technology & Engineering Solutions of Sandia, LLC diff --git a/tests/unit/test_variant_serializer.cc b/tests/unit/test_variant_serializer.cc index 62e94a34..ae4af2be 100644 --- a/tests/unit/test_variant_serializer.cc +++ b/tests/unit/test_variant_serializer.cc @@ -2,8 +2,7 @@ //@HEADER // ***************************************************************************** // -// test_variant_serialize.cc -// DARMA Toolkit v. 1.0.0 +// test_variant_serializer.cc // DARMA/checkpoint => Serialization Library // // Copyright 2019 National Technology & Engineering Solutions of Sandia, LLC diff --git a/tests/unit/test_vector_bool_serialize.cc b/tests/unit/test_vector_bool_serialize.cc index 41b486e7..891a02f9 100644 --- a/tests/unit/test_vector_bool_serialize.cc +++ b/tests/unit/test_vector_bool_serialize.cc @@ -2,7 +2,7 @@ //@HEADER // ***************************************************************************** // -// test_vector_bool_serialize.cc +// test_vector_bool_serialize.cc // DARMA/checkpoint => Serialization Library // // Copyright 2019 National Technology & Engineering Solutions of Sandia, LLC diff --git a/tests/unit/test_vector_serializer.cc b/tests/unit/test_vector_serializer.cc index 44e0fab7..b5262ce1 100644 --- a/tests/unit/test_vector_serializer.cc +++ b/tests/unit/test_vector_serializer.cc @@ -2,8 +2,7 @@ //@HEADER // ***************************************************************************** // -// test_vector_serialize.cc -// DARMA Toolkit v. 1.0.0 +// test_vector_serializer.cc // DARMA/checkpoint => Serialization Library // // Copyright 2019 National Technology & Engineering Solutions of Sandia, LLC diff --git a/tests/unit/tests_mpi/test_kokkos_serialize_2d_mpi_left.cc b/tests/unit/tests_mpi/test_kokkos_serialize_2d_mpi_left.cc index c8edc96a..4147e380 100644 --- a/tests/unit/tests_mpi/test_kokkos_serialize_2d_mpi_left.cc +++ b/tests/unit/tests_mpi/test_kokkos_serialize_2d_mpi_left.cc @@ -2,7 +2,7 @@ //@HEADER // ***************************************************************************** // -// test_kokkos_serialize_2d_mpi.cc +// test_kokkos_serialize_2d_mpi_left.cc // DARMA/checkpoint => Serialization Library // // Copyright 2019 National Technology & Engineering Solutions of Sandia, LLC diff --git a/tests/unit/tests_mpi/test_kokkos_serialize_2d_mpi_right.cc b/tests/unit/tests_mpi/test_kokkos_serialize_2d_mpi_right.cc index b267e53a..65676cdc 100644 --- a/tests/unit/tests_mpi/test_kokkos_serialize_2d_mpi_right.cc +++ b/tests/unit/tests_mpi/test_kokkos_serialize_2d_mpi_right.cc @@ -2,7 +2,7 @@ //@HEADER // ***************************************************************************** // -// test_kokkos_serialize_2d_mpi.cc +// test_kokkos_serialize_2d_mpi_right.cc // DARMA/checkpoint => Serialization Library // // Copyright 2019 National Technology & Engineering Solutions of Sandia, LLC diff --git a/tests/unit/tests_mpi/test_kokkos_serialize_2d_mpi_stride.cc b/tests/unit/tests_mpi/test_kokkos_serialize_2d_mpi_stride.cc index e150c3e3..8581bb72 100644 --- a/tests/unit/tests_mpi/test_kokkos_serialize_2d_mpi_stride.cc +++ b/tests/unit/tests_mpi/test_kokkos_serialize_2d_mpi_stride.cc @@ -2,7 +2,7 @@ //@HEADER // ***************************************************************************** // -// test_kokkos_serialize_2d_mpi.cc +// test_kokkos_serialize_2d_mpi_stride.cc // DARMA/checkpoint => Serialization Library // // Copyright 2019 National Technology & Engineering Solutions of Sandia, LLC diff --git a/tests/unit/tests_mpi/test_kokkos_serialize_3d_mpi_left.cc b/tests/unit/tests_mpi/test_kokkos_serialize_3d_mpi_left.cc index 84ab28d9..eace4609 100644 --- a/tests/unit/tests_mpi/test_kokkos_serialize_3d_mpi_left.cc +++ b/tests/unit/tests_mpi/test_kokkos_serialize_3d_mpi_left.cc @@ -2,7 +2,7 @@ //@HEADER // ***************************************************************************** // -// test_kokkos_serialize_3d_mpi.cc +// test_kokkos_serialize_3d_mpi_left.cc // DARMA/checkpoint => Serialization Library // // Copyright 2019 National Technology & Engineering Solutions of Sandia, LLC diff --git a/tests/unit/tests_mpi/test_kokkos_serialize_3d_mpi_right.cc b/tests/unit/tests_mpi/test_kokkos_serialize_3d_mpi_right.cc index ea124b0e..0e6c28b0 100644 --- a/tests/unit/tests_mpi/test_kokkos_serialize_3d_mpi_right.cc +++ b/tests/unit/tests_mpi/test_kokkos_serialize_3d_mpi_right.cc @@ -2,7 +2,7 @@ //@HEADER // ***************************************************************************** // -// test_kokkos_serialize_3d_mpi.cc +// test_kokkos_serialize_3d_mpi_right.cc // DARMA/checkpoint => Serialization Library // // Copyright 2019 National Technology & Engineering Solutions of Sandia, LLC diff --git a/tests/unit/tests_mpi/test_kokkos_serialize_3d_mpi_stride.cc b/tests/unit/tests_mpi/test_kokkos_serialize_3d_mpi_stride.cc index a312b13f..92d43813 100644 --- a/tests/unit/tests_mpi/test_kokkos_serialize_3d_mpi_stride.cc +++ b/tests/unit/tests_mpi/test_kokkos_serialize_3d_mpi_stride.cc @@ -2,7 +2,7 @@ //@HEADER // ***************************************************************************** // -// test_kokkos_serialize_3d_mpi.cc +// test_kokkos_serialize_3d_mpi_stride.cc // DARMA/checkpoint => Serialization Library // // Copyright 2019 National Technology & Engineering Solutions of Sandia, LLC From d875e1af353a71a2fceef9d14a76feb0992e1c13 Mon Sep 17 00:00:00 2001 From: Arkadiusz Szczepkowicz Date: Fri, 31 May 2024 16:37:36 +0200 Subject: [PATCH 3/6] #341: Add new script for generating and checking header guards --- .../workflows/check_license_and_guards.yml | 16 +++ scripts/check_guards.sh | 24 ++++ scripts/check_license.sh | 17 --- scripts/generate_header_guards_and_license.py | 135 ++++++++++++++++++ 4 files changed, 175 insertions(+), 17 deletions(-) create mode 100644 .github/workflows/check_license_and_guards.yml create mode 100755 scripts/check_guards.sh delete mode 100755 scripts/check_license.sh create mode 100644 scripts/generate_header_guards_and_license.py diff --git a/.github/workflows/check_license_and_guards.yml b/.github/workflows/check_license_and_guards.yml new file mode 100644 index 00000000..1ab98b5e --- /dev/null +++ b/.github/workflows/check_license_and_guards.yml @@ -0,0 +1,16 @@ +name: Check License and Header Guards + +on: pull_request + +jobs: + check-license-and-guards: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + + - name: Install dependencies + run: sudo apt-get update && sudo apt-get install libfile-find-rule-perl + + - name: Check license and header guards + shell: bash + run: ./scripts/check_guards.sh $(pwd) true diff --git a/scripts/check_guards.sh b/scripts/check_guards.sh new file mode 100755 index 00000000..88298682 --- /dev/null +++ b/scripts/check_guards.sh @@ -0,0 +1,24 @@ +#!/usr/bin/env bash + +path_to_magistrate=${1} +show_fix_command=${2} +cd "$path_to_magistrate" || exit 1 + +for sub_dir in "src" "tests" "examples" +do + python3 "${path_to_magistrate}/scripts/generate_header_guards_and_license.py" -s=${sub_dir} -l="${path_to_magistrate}/scripts/license-template" +done + +# Check for modified files +modified_files=$(git ls-files -m) + +if [ -n "$modified_files" ]; then + echo "The following files have been modified by updating the license or header guards:" + echo "$modified_files" + + if [ "$show_fix_command" == true ]; then + echo "" + echo "Please run the following command from main magistrate directory to fix them:" + echo "./scripts/check_guards.sh ." + fi +fi \ No newline at end of file diff --git a/scripts/check_license.sh b/scripts/check_license.sh deleted file mode 100755 index 109c477b..00000000 --- a/scripts/check_license.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash - -path_to_magistrate=${1} -cd "$path_to_magistrate" || exit 1 - -for sub_dir in "src" "tests" "examples" -do - "$path_to_magistrate/scripts/add-license-perl.pl" "$path_to_magistrate/$sub_dir" "$path_to_magistrate/scripts/license-template" -done - -result=$(git diff --name-only) - -if [ -n "$result" ]; then - echo -e "Following files have incorrect license!\n" - echo "$result" - exit 1 -fi diff --git a/scripts/generate_header_guards_and_license.py b/scripts/generate_header_guards_and_license.py new file mode 100644 index 00000000..0c4adb55 --- /dev/null +++ b/scripts/generate_header_guards_and_license.py @@ -0,0 +1,135 @@ +import os +import re +import argparse as ap + +def has_license_header(lines): + """ + Check if the first two lines contain the license header start. + """ + if len(lines) >= 2 and lines[0] == "/*\n" and lines[1] == "//@HEADER\n": + return True + return False + +def find_existing_guards(lines): + """ + Find the range of lines containing existing header guards. + """ + ifndef_pattern = re.compile(r'#(?:if !defined|ifndef)\s+([A-Z0-9_]+)') + define_pattern = re.compile(r'#define\s+([A-Z0-9_]+)') + endif_pattern = re.compile(r'#endif') + + ifndef_start = None + define_line = None + endif_line = None + + for i, line in enumerate(lines): + if ifndef_start is None: + match = ifndef_pattern.match(line) + if match: + ifndef_start = i + if ifndef_start is not None and define_line is None: + match = define_pattern.match(line) + if match: + define_line = i + if ifndef_start is not None and define_line is not None: + match = endif_pattern.match(line) + if match: + endif_line = i + + if ifndef_start is not None and define_line is not None and endif_line is not None: + return ifndef_start, endif_line + return None, None + + +def generate_license(file_path, license_path): + with open(file_path, 'r') as file: + lines = file.readlines() + + with open(license_path, 'r') as license_file: + license_file = license_file.readlines() + + file_name = os.path.basename(file_path) + lenright = int((80 - 2 - len(file_name))/2) + license_file[3] = f"//{' ' :<{lenright}}{file_name}\n" + + # Remove leading empty lines + non_empty_lines_start = 0 + for i, line in enumerate(lines): + if line.strip() != '': + non_empty_lines_start = i + break + + trimmed_lines = lines[non_empty_lines_start:] + + existing_license_start = -1 + existing_license_end = -1 + for i, line in enumerate(trimmed_lines): + if line.startswith("//@HEADER"): + if existing_license_start == -1: + existing_license_start = i + elif existing_license_end == -1: + existing_license_end = i + break + + if existing_license_start != -1: + updated_file = trimmed_lines[:existing_license_start] + license_file + trimmed_lines[existing_license_end + 1:] + else: + updated_file = ['/*\n'] + license_file + ['*/\n'] + trimmed_lines + + with open(file_path, 'w') as file: + file.writelines(updated_file) + + + +def generate_header_guard(file_path, root): + with open(file_path, 'r') as file: + lines = file.readlines() + + has_license = has_license_header(lines) + + # Create a header guard macro name based on the file name + base_name = os.path.relpath(file_path, root).upper().replace('/', '_').replace('.', '_').replace('-', '_') + guard_name = f'INCLUDED_{base_name}' + + # Add header guards + ifndef_guard = f'#if !defined {guard_name}\n#define {guard_name}\n' + endif_guard = f'#endif /*{guard_name}*/\n' + + # Detect existing guards + start_line, end_line = find_existing_guards(lines) + + if has_license: + license_content = ''.join(lines[:42]) + file_content = ''.join(lines[42:]) + else: + license_content = '' + file_content = ''.join(lines) + + if start_line is not None and end_line is not None: + # Replace existing guards + new_content = license_content + "\n" + ifndef_guard + ''.join(lines[start_line+2:end_line]) + endif_guard + else: + # Insert new guards + new_content = license_content + "\n" + ifndef_guard + file_content + endif_guard + + with open(file_path, 'w') as file: + file.write(new_content) + +def main(): + parser = ap.ArgumentParser() + parser.add_argument("--src_dir", "-s", dest='src_dir', required=True) + parser.add_argument("--license", "-l", dest='license_path', required=True) + args = parser.parse_args() + + src_dir_abs = os.path.abspath(os.path.expanduser(args.src_dir)) + license_path_abs = os.path.abspath(os.path.expanduser(args.license_path)) + for root, _, files in os.walk(src_dir_abs): + if "extern" not in root.split(os.sep): # skip googletest + for file in files: + if file.endswith('.h') or file.endswith('.cc'): + generate_license(os.path.join(root, file), license_path_abs) + if file.endswith('.h'): + generate_header_guard(os.path.join(root, file), src_dir_abs) + +if __name__ == '__main__': + main() \ No newline at end of file From 68835ac970ed0f7770cfec8d181b918a662ccd6a Mon Sep 17 00:00:00 2001 From: Arkadiusz Szczepkowicz Date: Fri, 31 May 2024 16:47:22 +0200 Subject: [PATCH 4/6] #341: Update chech_guards script to fail when there are files which needs modification --- scripts/check_guards.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/check_guards.sh b/scripts/check_guards.sh index 88298682..741cffda 100755 --- a/scripts/check_guards.sh +++ b/scripts/check_guards.sh @@ -13,12 +13,12 @@ done modified_files=$(git ls-files -m) if [ -n "$modified_files" ]; then - echo "The following files have been modified by updating the license or header guards:" + echo "The following files require an update to the license or header guards:" echo "$modified_files" if [ "$show_fix_command" == true ]; then - echo "" echo "Please run the following command from main magistrate directory to fix them:" echo "./scripts/check_guards.sh ." fi + exit 1 fi \ No newline at end of file From c6ad452a129460e7ec46e58d80b2576a0dd05e93 Mon Sep 17 00:00:00 2001 From: Arkadiusz Szczepkowicz Date: Tue, 4 Jun 2024 14:27:28 +0200 Subject: [PATCH 5/6] #341: Update CI job name --- .github/workflows/check_license_and_guards.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/check_license_and_guards.yml b/.github/workflows/check_license_and_guards.yml index 1ab98b5e..c018ad46 100644 --- a/.github/workflows/check_license_and_guards.yml +++ b/.github/workflows/check_license_and_guards.yml @@ -3,7 +3,8 @@ name: Check License and Header Guards on: pull_request jobs: - check-license-and-guards: + check: + name: Check License/Guards runs-on: ubuntu-latest steps: - uses: actions/checkout@master From cffcbc0639de3d3c72a57626042af37e67b87165 Mon Sep 17 00:00:00 2001 From: Arkadiusz Szczepkowicz Date: Tue, 4 Jun 2024 14:29:35 +0200 Subject: [PATCH 6/6] #341: Update old header guards --- src/checkpoint/detector.h | 2 +- tests/unit/test_commons.h | 7 ++++--- tests/unit/test_harness.h | 6 +++--- tests/unit/test_kokkos_0d_commons.h | 7 ++++--- tests/unit/test_kokkos_1d_commons.h | 7 ++++--- tests/unit/test_kokkos_2d_commons.h | 7 ++++--- tests/unit/test_kokkos_3d_commons.h | 7 ++++--- tests/unit/test_kokkos_integration_commons.h | 7 ++++--- tests/unit/tests_mpi/mpi-init.h | 7 ++++--- tests/unit/tests_mpi/test_commons_mpi.h | 7 ++++--- 10 files changed, 36 insertions(+), 28 deletions(-) diff --git a/src/checkpoint/detector.h b/src/checkpoint/detector.h index 128c651f..dad2855a 100644 --- a/src/checkpoint/detector.h +++ b/src/checkpoint/detector.h @@ -91,4 +91,4 @@ using is_detected_convertible = std::is_convertible, T>; } // end detection -#endif /* INCLUDED_CHECKPOINT_DETECTOR_H */ +#endif /*INCLUDED_CHECKPOINT_DETECTOR_H*/ diff --git a/tests/unit/test_commons.h b/tests/unit/test_commons.h index 568d6d03..41792e6f 100644 --- a/tests/unit/test_commons.h +++ b/tests/unit/test_commons.h @@ -40,8 +40,9 @@ // ***************************************************************************** //@HEADER */ -#ifndef TEST_COMMONS_H -#define TEST_COMMONS_H + +#if !defined INCLUDED_UNIT_TEST_COMMONS_H +#define INCLUDED_UNIT_TEST_COMMONS_H #include "test_harness.h" @@ -179,4 +180,4 @@ std::unique_ptr serializeAny( } } //end namespace -#endif // TEST_COMMONS_H +#endif /*INCLUDED_UNIT_TEST_COMMONS_H*/ diff --git a/tests/unit/test_harness.h b/tests/unit/test_harness.h index 14aa4b11..61bee244 100644 --- a/tests/unit/test_harness.h +++ b/tests/unit/test_harness.h @@ -41,8 +41,8 @@ //@HEADER */ -#if !defined INCLUDED_CHECKPOINT_TEST_HARNESS -#define INCLUDED_CHECKPOINT_TEST_HARNESS +#if !defined INCLUDED_UNIT_TEST_HARNESS_H +#define INCLUDED_UNIT_TEST_HARNESS_H #include @@ -89,4 +89,4 @@ using TestHarness = TestHarnessAny; }}} // end namespace checkpoint::tests::unit -#endif /*INCLUDED_CHECKPOINT_TEST_HARNESS*/ +#endif /*INCLUDED_UNIT_TEST_HARNESS_H*/ diff --git a/tests/unit/test_kokkos_0d_commons.h b/tests/unit/test_kokkos_0d_commons.h index 57db761f..79491099 100644 --- a/tests/unit/test_kokkos_0d_commons.h +++ b/tests/unit/test_kokkos_0d_commons.h @@ -40,8 +40,9 @@ // ***************************************************************************** //@HEADER */ -#ifndef TEST_KOKKOS_0D_COMMONS_H -#define TEST_KOKKOS_0D_COMMONS_H + +#if !defined INCLUDED_UNIT_TEST_KOKKOS_0D_COMMONS_H +#define INCLUDED_UNIT_TEST_KOKKOS_0D_COMMONS_H #include "test_commons.h" @@ -76,4 +77,4 @@ using Test0DTypes = testing::Types< #endif -#endif // TEST_KOKKOS_0D_COMMONS_H +#endif /*INCLUDED_UNIT_TEST_KOKKOS_0D_COMMONS_H*/ diff --git a/tests/unit/test_kokkos_1d_commons.h b/tests/unit/test_kokkos_1d_commons.h index bc8227e0..22c52a92 100644 --- a/tests/unit/test_kokkos_1d_commons.h +++ b/tests/unit/test_kokkos_1d_commons.h @@ -40,8 +40,9 @@ // ***************************************************************************** //@HEADER */ -#ifndef TEST_KOKKOS_1D_COMMONS_H -#define TEST_KOKKOS_1D_COMMONS_H + +#if !defined INCLUDED_UNIT_TEST_KOKKOS_1D_COMMONS_H +#define INCLUDED_UNIT_TEST_KOKKOS_1D_COMMONS_H #include "test_commons.h" @@ -185,4 +186,4 @@ using DynRankViewTestTypes = testing::Types< #endif -#endif // TEST_KOKKOS_1D_COMMONS_H +#endif /*INCLUDED_UNIT_TEST_KOKKOS_1D_COMMONS_H*/ diff --git a/tests/unit/test_kokkos_2d_commons.h b/tests/unit/test_kokkos_2d_commons.h index 9de9e68a..95e48c3b 100644 --- a/tests/unit/test_kokkos_2d_commons.h +++ b/tests/unit/test_kokkos_2d_commons.h @@ -40,8 +40,9 @@ // ***************************************************************************** //@HEADER */ -#ifndef TEST_KOKKOS_2D_COMMONS_H -#define TEST_KOKKOS_2D_COMMONS_H + +#if !defined INCLUDED_UNIT_TEST_KOKKOS_2D_COMMONS_H +#define INCLUDED_UNIT_TEST_KOKKOS_2D_COMMONS_H #include "test_commons.h" @@ -154,4 +155,4 @@ using Test2DConstTypesStride = #endif -#endif // TEST_KOKKOS_2D_COMMONS_H +#endif /*INCLUDED_UNIT_TEST_KOKKOS_2D_COMMONS_H*/ diff --git a/tests/unit/test_kokkos_3d_commons.h b/tests/unit/test_kokkos_3d_commons.h index fd61fba4..f4710445 100644 --- a/tests/unit/test_kokkos_3d_commons.h +++ b/tests/unit/test_kokkos_3d_commons.h @@ -40,8 +40,9 @@ // ***************************************************************************** //@HEADER */ -#ifndef TEST_KOKKOS_3D_COMMONS_H -#define TEST_KOKKOS_3D_COMMONS_H + +#if !defined INCLUDED_UNIT_TEST_KOKKOS_3D_COMMONS_H +#define INCLUDED_UNIT_TEST_KOKKOS_3D_COMMONS_H #include "test_commons.h" @@ -191,4 +192,4 @@ TYPED_TEST_P(KokkosViewTest3D, test_3d_any) { } } -#endif // TEST_KOKKOS_3D_COMMONS_H +#endif /*INCLUDED_UNIT_TEST_KOKKOS_3D_COMMONS_H*/ diff --git a/tests/unit/test_kokkos_integration_commons.h b/tests/unit/test_kokkos_integration_commons.h index a97243fa..39bfe427 100644 --- a/tests/unit/test_kokkos_integration_commons.h +++ b/tests/unit/test_kokkos_integration_commons.h @@ -40,8 +40,9 @@ // ***************************************************************************** //@HEADER */ -#ifndef TEST_KOKKOS_INTEGRATION_COMMONS_H -#define TEST_KOKKOS_INTEGRATION_COMMONS_H + +#if !defined INCLUDED_UNIT_TEST_KOKKOS_INTEGRATION_COMMONS_H +#define INCLUDED_UNIT_TEST_KOKKOS_INTEGRATION_COMMONS_H #include "test_harness.h" #include "test_commons.h" @@ -272,4 +273,4 @@ struct Data : BaseData { struct KokkosBaseTest : virtual testing::Test { }; -#endif // TEST_KOKKOS_INTEGRATION_COMMONS_H +#endif /*INCLUDED_UNIT_TEST_KOKKOS_INTEGRATION_COMMONS_H*/ diff --git a/tests/unit/tests_mpi/mpi-init.h b/tests/unit/tests_mpi/mpi-init.h index 6917f573..10d26d51 100644 --- a/tests/unit/tests_mpi/mpi-init.h +++ b/tests/unit/tests_mpi/mpi-init.h @@ -40,8 +40,9 @@ // ***************************************************************************** //@HEADER */ -#ifndef MPIINIT_H -#define MPIINIT_H + +#if !defined INCLUDED_UNIT_TESTS_MPI_MPI_INIT_H +#define INCLUDED_UNIT_TESTS_MPI_MPI_INIT_H #include #include @@ -94,4 +95,4 @@ class MPIEnvironment : public ::testing::Environment }; -#endif // MPIINIT_H +#endif /*INCLUDED_UNIT_TESTS_MPI_MPI_INIT_H*/ diff --git a/tests/unit/tests_mpi/test_commons_mpi.h b/tests/unit/tests_mpi/test_commons_mpi.h index e5324a58..a48173ed 100644 --- a/tests/unit/tests_mpi/test_commons_mpi.h +++ b/tests/unit/tests_mpi/test_commons_mpi.h @@ -40,8 +40,9 @@ // ***************************************************************************** //@HEADER */ -#ifndef TEST_COMMONS_MPI_H -#define TEST_COMMONS_MPI_H + +#if !defined INCLUDED_UNIT_TESTS_MPI_TEST_COMMONS_MPI_H +#define INCLUDED_UNIT_TESTS_MPI_TEST_COMMONS_MPI_H #include "test_commons.h" #include "test_kokkos_0d_commons.h" @@ -88,4 +89,4 @@ void serializeAnyMPI(T& view, std::function compare) { } } // end namespace -#endif // TEST_COMMONS_MPI_H +#endif /*INCLUDED_UNIT_TESTS_MPI_TEST_COMMONS_MPI_H*/