Skip to content

Commit e05a902

Browse files
authored
Run cmake-format on all CMake files (#936)
* Run cmake-format on all CMake files * tab size 4 * reformat tests
1 parent f81bdb9 commit e05a902

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+874
-404
lines changed

.cmake-format.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
format:
2+
tab_size: 4

CMakeLists.txt

+249-183
Large diffs are not rendered by default.

CMakeTests.cmake

+123-72
Large diffs are not rendered by default.

cmake/TestWrapValgrind.cmake

+18-17
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,37 @@
11
# Copyright 2018 Uber Technologies, Inc.
22
#
3-
# Licensed under the Apache License, Version 2.0 (the "License");
4-
# you may not use this file except in compliance with the License.
5-
# You may obtain a copy of the License at
3+
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
4+
# use this file except in compliance with the License. You may obtain a copy of
5+
# the License at
66
#
7-
# http://www.apache.org/licenses/LICENSE-2.0
7+
# http://www.apache.org/licenses/LICENSE-2.0
88
#
99
# Unless required by applicable law or agreed to in writing, software
10-
# distributed under the License is distributed on an "AS IS" BASIS,
11-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12-
# See the License for the specific language governing permissions and
13-
# limitations under the License.
10+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12+
# License for the specific language governing permissions and limitations under
13+
# the License.
1414

1515
# Support code for wrapping tests or other executables with Valgrind.
1616

1717
if(__test_wrap_valgrind)
18-
return()
18+
return()
1919
endif()
2020
set(__test_wrap_valgrind 1)
2121

2222
include(CMakeDependentOption)
2323

2424
find_program(VALGRIND valgrind)
25-
cmake_dependent_option(WRAP_VALGRIND "Wrap tests in valgrind" OFF
26-
"VALGRIND" OFF)
25+
cmake_dependent_option(WRAP_VALGRIND "Wrap tests in valgrind" OFF "VALGRIND"
26+
OFF)
2727
if(WRAP_VALGRIND)
28-
# TEST_WRAPPER could be used to configure the Valgrind parameters, or
29-
# to use a different wrapper entirely.
30-
set(TEST_WRAPPER ${VALGRIND} --track-origins=yes --leak-check=full --error-exitcode=99 CACHE STRING
31-
"Wrapper executable for tests and benchmarks")
28+
# TEST_WRAPPER could be used to configure the Valgrind parameters, or to use
29+
# a different wrapper entirely.
30+
set(TEST_WRAPPER
31+
${VALGRIND} --track-origins=yes --leak-check=full --error-exitcode=99
32+
CACHE STRING "Wrapper executable for tests and benchmarks")
3233
mark_as_advanced(TEST_WRAPPER)
33-
# Convert from semicolon separated list of values to a form
34-
# that can be used by a shell.
34+
# Convert from semicolon separated list of values to a form that can be used
35+
# by a shell.
3536
string(REPLACE ";" " " TEST_WRAPPER_STR "${TEST_WRAPPER}")
3637
endif()

tests/cli/areNeighborCells.txt

+9-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1-
add_h3_cli_test(testCliAreNeighborCells "areNeighborCells -o 85283473fffffff -d 85283477fffffff" "true")
2-
add_h3_cli_test(testCliAreNotNeighborCells "areNeighborCells -o 85283473fffffff -d 85283472fffffff" "false")
3-
add_h3_cli_test(testCliAreNeighborNotCells "areNeighborCells -o 85283473fffffff -d 852834727fffffff 2>&1" "Error 5: Cell argument was not valid")
1+
add_h3_cli_test(testCliAreNeighborCells
2+
"areNeighborCells -o 85283473fffffff -d 85283477fffffff" "true")
3+
add_h3_cli_test(
4+
testCliAreNotNeighborCells
5+
"areNeighborCells -o 85283473fffffff -d 85283472fffffff" "false")
6+
add_h3_cli_test(
7+
testCliAreNeighborNotCells
8+
"areNeighborCells -o 85283473fffffff -d 852834727fffffff 2>&1"
9+
"Error 5: Cell argument was not valid")

tests/cli/cellAreaKm2.txt

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1-
add_h3_cli_test(testCliCellAreaKm2 "cellAreaKm2 -c 85283473fffffff" "265.0925581283")
2-
add_h3_cli_test(testCliNotCellAreaKm2 "cellAreaKm2 -c 115283473fffffff 2>&1" "Error 5: Cell argument was not valid")
1+
add_h3_cli_test(testCliCellAreaKm2 "cellAreaKm2 -c 85283473fffffff"
2+
"265.0925581283")
3+
add_h3_cli_test(testCliNotCellAreaKm2 "cellAreaKm2 -c 115283473fffffff 2>&1"
4+
"Error 5: Cell argument was not valid")

tests/cli/cellAreaM2.txt

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
1-
add_h3_cli_test(testCliCellAreaM2 "cellAreaM2 -c 85283473fffffff | xargs printf '%.3f'" "265092558.128")
2-
add_h3_cli_test(testCliNotCellAreaM2 "cellAreaM2 -c 115283473fffffff 2>&1" "Error 5: Cell argument was not valid")
1+
add_h3_cli_test(
2+
testCliCellAreaM2 "cellAreaM2 -c 85283473fffffff | xargs printf '%.3f'"
3+
"265092558.128")
4+
add_h3_cli_test(testCliNotCellAreaM2 "cellAreaM2 -c 115283473fffffff 2>&1"
5+
"Error 5: Cell argument was not valid")

tests/cli/cellAreaRads2.txt

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
1-
add_h3_cli_test(testCliCellAreaRads2 "cellAreaRads2 -c 85283473fffffff" "0.0000065310")
2-
add_h3_cli_test(testCliNotCellAreaRads2 "cellAreaRads2 -c 115283473fffffff 2>&1" "Error 5: Cell argument was not valid")
1+
add_h3_cli_test(testCliCellAreaRads2 "cellAreaRads2 -c 85283473fffffff"
2+
"0.0000065310")
3+
add_h3_cli_test(
4+
testCliNotCellAreaRads2 "cellAreaRads2 -c 115283473fffffff 2>&1"
5+
"Error 5: Cell argument was not valid")

tests/cli/cellToBoundary.txt

+5-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
1-
add_h3_cli_test(testCliCellToBoundary "cellToBoundary -c 8928342e20fffff -f wkt" "POLYGON((-122.4990471431 37.4997389893, -122.4979805011 37.5014245698, -122.4992373065 37.5029321860, -122.5015607527 37.5027541980, -122.5026273256 37.5010686174, -122.5013705214 37.4995610248, -122.4990471431 37.4997389893))")
1+
add_h3_cli_test(
2+
testCliCellToBoundary
3+
"cellToBoundary -c 8928342e20fffff -f wkt"
4+
"POLYGON((-122.4990471431 37.4997389893, -122.4979805011 37.5014245698, -122.4992373065 37.5029321860, -122.5015607527 37.5027541980, -122.5026273256 37.5010686174, -122.5013705214 37.4995610248, -122.4990471431 37.4997389893))"
5+
)

tests/cli/cellToCenterChild.txt

+4-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1-
add_h3_cli_test(testCliCellToCenterChild "cellToCenterChild -c 85283473fffffff --resolution 7 -f newline" "872834700ffffff")
1+
add_h3_cli_test(
2+
testCliCellToCenterChild
3+
"cellToCenterChild -c 85283473fffffff --resolution 7 -f newline"
4+
"872834700ffffff")

tests/cli/cellToChildPos.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
add_h3_cli_test(testCliCellToChildPos "cellToChildPos -c 85283473fffffff -r 3" "25")
1+
add_h3_cli_test(testCliCellToChildPos "cellToChildPos -c 85283473fffffff -r 3"
2+
"25")

tests/cli/cellToChildren.txt

+5-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
1-
add_h3_cli_test(testCliCellToChildren "cellToChildren -c 85283473fffffff -r 6" "[ \"862834707ffffff\", \"86283470fffffff\", \"862834717ffffff\", \"86283471fffffff\", \"862834727ffffff\", \"86283472fffffff\", \"862834737ffffff\" ]")
1+
add_h3_cli_test(
2+
testCliCellToChildren
3+
"cellToChildren -c 85283473fffffff -r 6"
4+
"[ \"862834707ffffff\", \"86283470fffffff\", \"862834717ffffff\", \"86283471fffffff\", \"862834727ffffff\", \"86283472fffffff\", \"862834737ffffff\" ]"
5+
)

tests/cli/cellToChildrenSize.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
add_h3_cli_test(testCliCellToChildrenSize "cellToChildrenSize -c 85283473fffffff -r 6" "7")
1+
add_h3_cli_test(testCliCellToChildrenSize
2+
"cellToChildrenSize -c 85283473fffffff -r 6" "7")

tests/cli/cellToLatLng.txt

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1-
add_h3_cli_test(testCliCellToLatLng "cellToLatLng -c 8928342e20fffff -f wkt" "POINT(-122.5003039349 37.5012466151)")
2-
add_h3_cli_test(testCliInvalidCellToLatLng "cellToLatLng -c asdf 2>&1" "Error 5: Cell argument was not valid")
1+
add_h3_cli_test(testCliCellToLatLng "cellToLatLng -c 8928342e20fffff -f wkt"
2+
"POINT(-122.5003039349 37.5012466151)")
3+
add_h3_cli_test(testCliInvalidCellToLatLng "cellToLatLng -c asdf 2>&1"
4+
"Error 5: Cell argument was not valid")

tests/cli/cellToLocalIj.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
add_h3_cli_test(testCliCellToLocalIj "cellToLocalIj -o 85283473fffffff -c 8528342bfffffff" "[25, 13]")
1+
add_h3_cli_test(
2+
testCliCellToLocalIj "cellToLocalIj -o 85283473fffffff -c 8528342bfffffff"
3+
"[25, 13]")

tests/cli/cellToParent.txt

+4-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1-
add_h3_cli_test(testCliCellToParent "cellToParent -c 8928342e20fffff --resolution 3 -f newline" "832834fffffffff")
1+
add_h3_cli_test(
2+
testCliCellToParent
3+
"cellToParent -c 8928342e20fffff --resolution 3 -f newline"
4+
"832834fffffffff")

tests/cli/cellToVertex.txt

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
1-
add_h3_cli_test(testCliCellToVertex "cellToVertex -c 85283473fffffff -v 0 -f newline" "22528340bfffffff")
2-
add_h3_cli_test(testCliNotCellToVertex "cellToVertex -c 115283473fffffff -v 0 2>&1" "Error 5: Cell argument was not valid")
1+
add_h3_cli_test(
2+
testCliCellToVertex "cellToVertex -c 85283473fffffff -v 0 -f newline"
3+
"22528340bfffffff")
4+
add_h3_cli_test(
5+
testCliNotCellToVertex "cellToVertex -c 115283473fffffff -v 0 2>&1"
6+
"Error 5: Cell argument was not valid")

tests/cli/cellToVertexes.txt

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,8 @@
1-
add_h3_cli_test(testCliCellToVertexes "cellToVertexes -c 85283473fffffff" "[ \"22528340bfffffff\", \"235283447fffffff\", \"205283463fffffff\", \"255283463fffffff\", \"22528340ffffffff\", \"23528340bfffffff\" ]")
2-
add_h3_cli_test(testCliNotCellToVertexes "cellToVertexes -c 115283473fffffff 2>&1" "Error 5: Cell argument was not valid")
1+
add_h3_cli_test(
2+
testCliCellToVertexes
3+
"cellToVertexes -c 85283473fffffff"
4+
"[ \"22528340bfffffff\", \"235283447fffffff\", \"205283463fffffff\", \"255283463fffffff\", \"22528340ffffffff\", \"23528340bfffffff\" ]"
5+
)
6+
add_h3_cli_test(
7+
testCliNotCellToVertexes "cellToVertexes -c 115283473fffffff 2>&1"
8+
"Error 5: Cell argument was not valid")

tests/cli/cellsToDirectedEdge.txt

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,8 @@
1-
add_h3_cli_test(testCliCellsToDirectedEdge "cellsToDirectedEdge -o 85283473fffffff -d 85283477fffffff -f newline" "115283473fffffff")
2-
add_h3_cli_test(testCliCellsNotToDirectedEdge "cellsToDirectedEdge -o 85283473fffffff -d 85283472fffffff 2>&1" "Error 11: Cell arguments were not neighbors")
1+
add_h3_cli_test(
2+
testCliCellsToDirectedEdge
3+
"cellsToDirectedEdge -o 85283473fffffff -d 85283477fffffff -f newline"
4+
"115283473fffffff")
5+
add_h3_cli_test(
6+
testCliCellsNotToDirectedEdge
7+
"cellsToDirectedEdge -o 85283473fffffff -d 85283472fffffff 2>&1"
8+
"Error 11: Cell arguments were not neighbors")

0 commit comments

Comments
 (0)