Skip to content

Commit

Permalink
Update .clang-format config to sort includes
Browse files Browse the repository at this point in the history
Also run the new configuration on all existing test and util files.
(However note that, as not all files fully conform to clang-format,
this only adds the changes to includes!).
  • Loading branch information
psalz committed Mar 5, 2021
1 parent 0673964 commit b694698
Show file tree
Hide file tree
Showing 44 changed files with 61 additions and 65 deletions.
2 changes: 1 addition & 1 deletion .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,6 @@ CommentPragmas: '^ IWYU pragma:'
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
SpaceBeforeParens: ControlStatements
DisableFormat: false
SortIncludes: false
SortIncludes: true
...

2 changes: 1 addition & 1 deletion tests/accessor/accessor_api_buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

#include "../common/common.h"
#include "./../../util/math_helper.h"
#include "accessor_utility.h"
#include "accessor_api_buffer_common.h"
#include "accessor_utility.h"

#define TEST_NAME accessor_api_buffer

Expand Down
4 changes: 2 additions & 2 deletions tests/accessor/accessor_api_buffer_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@

#include "../common/common.h"
#include "./../../util/math_helper.h"
#include "accessor_utility.h"
#include "accessor_api_common_buffer_local.h"
#include "accessor_api_common_all.h"
#include "accessor_api_common_buffer_local.h"
#include "accessor_utility.h"

namespace {

Expand Down
2 changes: 1 addition & 1 deletion tests/accessor/accessor_api_buffer_fp16.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

#include "../common/common.h"
#include "./../../util/math_helper.h"
#include "accessor_utility.h"
#include "accessor_api_buffer_common.h"
#include "accessor_utility.h"

#define TEST_NAME accessor_api_buffer_fp16

Expand Down
2 changes: 1 addition & 1 deletion tests/accessor/accessor_api_buffer_fp64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

#include "../common/common.h"
#include "./../../util/math_helper.h"
#include "accessor_utility.h"
#include "accessor_api_buffer_common.h"
#include "accessor_utility.h"

#define TEST_NAME accessor_api_buffer_fp64

Expand Down
2 changes: 1 addition & 1 deletion tests/accessor/accessor_api_common_buffer_local.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@

#include "../common/common.h"
#include "accessor_utility.h"
#include <stdexcept>
#include <sstream>
#include <stdexcept>
#include <utility>
#include <vector>

Expand Down
2 changes: 1 addition & 1 deletion tests/accessor/accessor_api_image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

#include "../common/common.h"
#include "./../../util/math_helper.h"
#include "accessor_utility.h"
#include "accessor_api_image_common.h"
#include "accessor_utility.h"

#include <array>
#include <numeric>
Expand Down
2 changes: 1 addition & 1 deletion tests/accessor/accessor_api_image_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@

#include "../common/common.h"
#include "./../../util/math_helper.h"
#include "accessor_utility.h"
#include "accessor_api_common_all.h"
#include "accessor_utility.h"

#include <array>
#include <numeric>
Expand Down
2 changes: 1 addition & 1 deletion tests/accessor/accessor_api_image_fp16.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

#include "../common/common.h"
#include "./../../util/math_helper.h"
#include "accessor_utility.h"
#include "accessor_api_image_common.h"
#include "accessor_utility.h"

#include <array>
#include <numeric>
Expand Down
2 changes: 1 addition & 1 deletion tests/accessor/accessor_api_local.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

#include "../common/common.h"
#include "./../../util/math_helper.h"
#include "accessor_utility.h"
#include "accessor_api_local_common.h"
#include "accessor_utility.h"

#include <array>
#include <numeric>
Expand Down
4 changes: 2 additions & 2 deletions tests/accessor/accessor_api_local_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@

#include "../common/common.h"
#include "./../../util/math_helper.h"
#include "accessor_utility.h"
#include "accessor_api_common_buffer_local.h"
#include "accessor_api_common_all.h"
#include "accessor_api_common_buffer_local.h"
#include "accessor_utility.h"

#include <array>
#include <numeric>
Expand Down
2 changes: 1 addition & 1 deletion tests/accessor/accessor_api_local_fp16.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

#include "../common/common.h"
#include "./../../util/math_helper.h"
#include "accessor_utility.h"
#include "accessor_api_local_common.h"
#include "accessor_utility.h"

#include <array>
#include <numeric>
Expand Down
2 changes: 1 addition & 1 deletion tests/accessor/accessor_api_local_fp64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

#include "../common/common.h"
#include "./../../util/math_helper.h"
#include "accessor_utility.h"
#include "accessor_api_local_common.h"
#include "accessor_utility.h"

#include <array>
#include <numeric>
Expand Down
2 changes: 1 addition & 1 deletion tests/accessor/accessor_constructors_buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
#define TEST_NAME accessor_constructors_buffer

#include "../common/common.h"
#include "accessor_constructors_utility.h"
#include "accessor_constructors_buffer_utility.h"
#include "accessor_constructors_utility.h"

namespace TEST_NAMESPACE {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
#define TEST_NAME accessor_constructors_buffer_placeholder

#include "../common/common.h"
#include "accessor_constructors_utility.h"
#include "accessor_constructors_buffer_utility.h"
#include "accessor_constructors_utility.h"

namespace TEST_NAMESPACE {

Expand Down
4 changes: 2 additions & 2 deletions tests/accessor/accessor_constructors_fp16.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
#define TEST_NAME accessor_constructors_fp16

#include "../common/common.h"
#include "accessor_constructors_utility.h"
#include "accessor_constructors_buffer_utility.h"
#include "accessor_constructors_local_utility.h"
#include "accessor_constructors_image_utility.h"
#include "accessor_constructors_local_utility.h"
#include "accessor_constructors_utility.h"

namespace TEST_NAMESPACE {
/** tests the constructors for cl::sycl::accessor
Expand Down
4 changes: 2 additions & 2 deletions tests/accessor/accessor_constructors_fp64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
#define TEST_NAME accessor_constructors_fp64

#include "../common/common.h"
#include "accessor_constructors_utility.h"
#include "accessor_constructors_buffer_utility.h"
#include "accessor_constructors_local_utility.h"
#include "accessor_constructors_image_utility.h"
#include "accessor_constructors_local_utility.h"
#include "accessor_constructors_utility.h"

namespace TEST_NAMESPACE {

Expand Down
2 changes: 1 addition & 1 deletion tests/accessor/accessor_constructors_image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
#define TEST_NAME accessor_constructors_image

#include "../common/common.h"
#include "accessor_constructors_utility.h"
#include "accessor_constructors_image_utility.h"
#include "accessor_constructors_utility.h"

namespace TEST_NAMESPACE {

Expand Down
2 changes: 1 addition & 1 deletion tests/accessor/accessor_constructors_local.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
#define TEST_NAME accessor_constructors_local

#include "../common/common.h"
#include "accessor_constructors_utility.h"
#include "accessor_constructors_local_utility.h"
#include "accessor_constructors_utility.h"

namespace TEST_NAMESPACE {

Expand Down
2 changes: 1 addition & 1 deletion tests/accessor/accessor_utility.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
#define SYCL_1_2_1_TESTS_ACCESSOR_ACCESSOR_UTILITY_H

#include "../common/common.h"
#include <stdexcept>
#include <sstream>
#include <stdexcept>
#include <utility>
#include <vector>

Expand Down
2 changes: 1 addition & 1 deletion tests/address_space/address_space.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

#include "../common/common.h"

#include <cassert>
#include <array>
#include <cassert>
#include <type_traits>

#define EXPECT_EQUALS(lhs, rhs) \
Expand Down
14 changes: 6 additions & 8 deletions tests/common/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,18 @@
// include our proxy to the real sycl header
#include "sycl.h"

// test framework specific device selector
#include "../common/cts_selector.h"
#include "../../util/math_vector.h"
#include "../../util/proxy.h"
#include "../../util/test_base.h"
#include "../common/cts_async_handler.h"
#include "../common/cts_selector.h"
#include "../common/get_cts_object.h"
#include "../../util/proxy.h"
#include "macros.h"

#include "../../util/test_base.h"
#include "../../util/math_vector.h"

#include <string>
#include <numeric>
#include <sstream>
#include <string>
#include <type_traits>
#include <numeric>

namespace {

Expand Down
10 changes: 4 additions & 6 deletions tests/common/common_vec.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,15 @@
// include our proxy to the real sycl header
#include "sycl.h"

// test framework specific device selector
#include "../../util/math_vector.h"
#include "../../util/proxy.h"
#include "../../util/test_base.h"
#include "../common/common.h"
#include "../common/cts_selector.h"
#include "../common/cts_async_handler.h"
#include "../common/cts_selector.h"
#include "../common/get_cts_object.h"
#include "../../util/proxy.h"
#include "macros.h"

#include "../../util/test_base.h"
#include "../../util/math_vector.h"

#include <string>
#include <type_traits>

Expand Down
2 changes: 1 addition & 1 deletion tests/common/macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
#ifndef __SYCLCTS_TESTS_COMMON_MACROS_H
#define __SYCLCTS_TESTS_COMMON_MACROS_H

#include "sycl.h"
#include "../../util/opencl_helper.h"
#include "../../util/type_names.h"
#include "sycl.h"

#define TEST_FILE __FILE__
#define TEST_BUILD_DATE __DATE__
Expand Down
2 changes: 1 addition & 1 deletion tests/common/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
#include <stdio.h>
#include <stdlib.h>

#include "./../../util/test_manager.h"
#include "./../../util/collection.h"
#include "./../../util/test_manager.h"

using namespace sycl_cts::util;

Expand Down
2 changes: 1 addition & 1 deletion tests/image/image_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
//
*******************************************************************************/

#include "image_common.h"
#include "../common/common.h"
#include "image_common.h"

#define TEST_NAME image_api_core

Expand Down
2 changes: 1 addition & 1 deletion tests/image/image_api_fp16.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
//
*******************************************************************************/

#include "image_common.h"
#include "../common/common.h"
#include "image_common.h"

#define TEST_NAME image_api_fp16

Expand Down
2 changes: 1 addition & 1 deletion tests/image/image_constructors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
//
*******************************************************************************/

#include "image_common.h"
#include "../common/common.h"
#include "image_common.h"

#define TEST_NAME image_constructors

Expand Down
2 changes: 1 addition & 1 deletion tests/opencl_interop/opencl_interop_constructors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
//
*******************************************************************************/

#include "../common/common.h"
#include "../../util/opencl_helper.h"
#include "../../util/test_base_opencl.h"
#include "../common/common.h"

#define TEST_NAME opencl_interop_constructors

Expand Down
2 changes: 1 addition & 1 deletion tests/opencl_interop/opencl_interop_get.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
//
*******************************************************************************/

#include "../common/common.h"
#include "../../util/opencl_helper.h"
#include "../../util/test_base_opencl.h"
#include "../common/common.h"

#define TEST_NAME opencl_interop_get

Expand Down
2 changes: 1 addition & 1 deletion tests/opencl_interop/opencl_interop_kernel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
//
*******************************************************************************/

#include "../common/common.h"
#include "../../util/opencl_helper.h"
#include "../../util/test_base_opencl.h"
#include "../common/common.h"

#define TEST_NAME opencl_interop_kernel

Expand Down
2 changes: 1 addition & 1 deletion util/cmdarg.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
#ifndef __SYCLCTS_UTIL_CMDARG_H
#define __SYCLCTS_UTIL_CMDARG_H

#include "stl.h"
#include "singleton.h"
#include "stl.h"

namespace sycl_cts {
namespace util {
Expand Down
2 changes: 1 addition & 1 deletion util/collection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
*******************************************************************************/

#include "collection.h"
#include "printer.h"
#include "csv.h"
#include "printer.h"

// conformance test suite namespace
namespace sycl_cts {
Expand Down
2 changes: 1 addition & 1 deletion util/collection.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
#ifndef __SYCLCTS_UTIL_COLLECTION_H
#define __SYCLCTS_UTIL_COLLECTION_H

#include "singleton.h"
#include "stl.h"
#include "test_base.h"
#include "singleton.h"

namespace sycl_cts {
namespace util {
Expand Down
4 changes: 2 additions & 2 deletions util/executor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
*******************************************************************************/

#include "executor.h"
#include "singleton.h"
#include "printer.h"
#include "collection.h"
#include "logger.h"
#include "printer.h"
#include "singleton.h"

namespace sycl_cts {
namespace util {
Expand Down
Loading

0 comments on commit b694698

Please sign in to comment.