1*61c4878aSAndroid Build Coastguard Worker# Copyright 2022 The Pigweed Authors 2*61c4878aSAndroid Build Coastguard Worker# 3*61c4878aSAndroid Build Coastguard Worker# Licensed under the Apache License, Version 2.0 (the "License"); you may not 4*61c4878aSAndroid Build Coastguard Worker# use this file except in compliance with the License. You may obtain a copy of 5*61c4878aSAndroid Build Coastguard Worker# the License at 6*61c4878aSAndroid Build Coastguard Worker# 7*61c4878aSAndroid Build Coastguard Worker# https://www.apache.org/licenses/LICENSE-2.0 8*61c4878aSAndroid Build Coastguard Worker# 9*61c4878aSAndroid Build Coastguard Worker# Unless required by applicable law or agreed to in writing, software 10*61c4878aSAndroid Build Coastguard Worker# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11*61c4878aSAndroid Build Coastguard Worker# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12*61c4878aSAndroid Build Coastguard Worker# License for the specific language governing permissions and limitations under 13*61c4878aSAndroid Build Coastguard Worker# the License. 14*61c4878aSAndroid Build Coastguard Worker"""Tests for pw_ide.cpp""" 15*61c4878aSAndroid Build Coastguard Worker 16*61c4878aSAndroid Build Coastguard Workerimport json 17*61c4878aSAndroid Build Coastguard Workerfrom pathlib import Path 18*61c4878aSAndroid Build Coastguard Workerfrom typing import cast 19*61c4878aSAndroid Build Coastguard Workerimport unittest 20*61c4878aSAndroid Build Coastguard Worker 21*61c4878aSAndroid Build Coastguard Worker# pylint: disable=protected-access 22*61c4878aSAndroid Build Coastguard Workerfrom pw_ide.cpp import ( 23*61c4878aSAndroid Build Coastguard Worker COMPDB_FILE_NAME, 24*61c4878aSAndroid Build Coastguard Worker command_parts, 25*61c4878aSAndroid Build Coastguard Worker path_to_executable, 26*61c4878aSAndroid Build Coastguard Worker CppCompilationDatabase, 27*61c4878aSAndroid Build Coastguard Worker CppCompilationDatabasesMap, 28*61c4878aSAndroid Build Coastguard Worker CppCompileCommand, 29*61c4878aSAndroid Build Coastguard Worker CppCompileCommandDict, 30*61c4878aSAndroid Build Coastguard Worker CppIdeFeaturesTarget, 31*61c4878aSAndroid Build Coastguard Worker CppIdeFeaturesState, 32*61c4878aSAndroid Build Coastguard Worker infer_target, 33*61c4878aSAndroid Build Coastguard Worker _infer_target_pos, 34*61c4878aSAndroid Build Coastguard Worker) 35*61c4878aSAndroid Build Coastguard Worker 36*61c4878aSAndroid Build Coastguard Workerfrom pw_ide.exceptions import UnresolvablePathException 37*61c4878aSAndroid Build Coastguard Worker 38*61c4878aSAndroid Build Coastguard Workerfrom test_cases import PwIdeTestCase 39*61c4878aSAndroid Build Coastguard Worker 40*61c4878aSAndroid Build Coastguard Worker 41*61c4878aSAndroid Build Coastguard Workerclass TestPathToExecutable(PwIdeTestCase): 42*61c4878aSAndroid Build Coastguard Worker """Tests path_to_executable""" 43*61c4878aSAndroid Build Coastguard Worker 44*61c4878aSAndroid Build Coastguard Worker def test_valid_absolute_path_in_env_returns_same_path(self): 45*61c4878aSAndroid Build Coastguard Worker executable_path = self.temp_dir_path / 'clang' 46*61c4878aSAndroid Build Coastguard Worker query_drivers = [f'{self.temp_dir_path}/*'] 47*61c4878aSAndroid Build Coastguard Worker result = path_to_executable( 48*61c4878aSAndroid Build Coastguard Worker str(executable_path.absolute()), path_globs=query_drivers 49*61c4878aSAndroid Build Coastguard Worker ) 50*61c4878aSAndroid Build Coastguard Worker self.assertIsNotNone(result) 51*61c4878aSAndroid Build Coastguard Worker self.assertEqual(str(result), str(executable_path.absolute())) 52*61c4878aSAndroid Build Coastguard Worker 53*61c4878aSAndroid Build Coastguard Worker def test_valid_absolute_path_outside_env_returns_same_path(self): 54*61c4878aSAndroid Build Coastguard Worker executable_path = Path('/usr/bin/clang') 55*61c4878aSAndroid Build Coastguard Worker query_drivers = ['/**/*'] 56*61c4878aSAndroid Build Coastguard Worker result = path_to_executable( 57*61c4878aSAndroid Build Coastguard Worker str(executable_path.absolute()), path_globs=query_drivers 58*61c4878aSAndroid Build Coastguard Worker ) 59*61c4878aSAndroid Build Coastguard Worker self.assertIsNotNone(result) 60*61c4878aSAndroid Build Coastguard Worker self.assertEqual(str(result), str(executable_path.absolute())) 61*61c4878aSAndroid Build Coastguard Worker 62*61c4878aSAndroid Build Coastguard Worker def test_valid_relative_path_returns_same_path(self): 63*61c4878aSAndroid Build Coastguard Worker executable_path = Path('../clang') 64*61c4878aSAndroid Build Coastguard Worker query_drivers = [f'{self.temp_dir_path}/*'] 65*61c4878aSAndroid Build Coastguard Worker result = path_to_executable( 66*61c4878aSAndroid Build Coastguard Worker str(executable_path), path_globs=query_drivers 67*61c4878aSAndroid Build Coastguard Worker ) 68*61c4878aSAndroid Build Coastguard Worker self.assertIsNotNone(result) 69*61c4878aSAndroid Build Coastguard Worker self.assertEqual(str(result), str(executable_path)) 70*61c4878aSAndroid Build Coastguard Worker 71*61c4878aSAndroid Build Coastguard Worker def test_valid_no_path_returns_new_path(self): 72*61c4878aSAndroid Build Coastguard Worker executable_path = Path('clang') 73*61c4878aSAndroid Build Coastguard Worker query_drivers = [f'{self.temp_dir_path}/*'] 74*61c4878aSAndroid Build Coastguard Worker expected_path = self.temp_dir_path / executable_path 75*61c4878aSAndroid Build Coastguard Worker self.touch_temp_file(expected_path) 76*61c4878aSAndroid Build Coastguard Worker result = path_to_executable( 77*61c4878aSAndroid Build Coastguard Worker str(executable_path), path_globs=query_drivers 78*61c4878aSAndroid Build Coastguard Worker ) 79*61c4878aSAndroid Build Coastguard Worker self.assertIsNotNone(result) 80*61c4878aSAndroid Build Coastguard Worker self.assertEqual(str(result), str(expected_path)) 81*61c4878aSAndroid Build Coastguard Worker 82*61c4878aSAndroid Build Coastguard Worker def test_invalid_absolute_path_in_env_returns_same_path(self): 83*61c4878aSAndroid Build Coastguard Worker executable_path = self.temp_dir_path / '_pw_invalid_exe' 84*61c4878aSAndroid Build Coastguard Worker query_drivers = [f'{self.temp_dir_path}/*'] 85*61c4878aSAndroid Build Coastguard Worker result = path_to_executable( 86*61c4878aSAndroid Build Coastguard Worker str(executable_path.absolute()), path_globs=query_drivers 87*61c4878aSAndroid Build Coastguard Worker ) 88*61c4878aSAndroid Build Coastguard Worker self.assertIsNone(result) 89*61c4878aSAndroid Build Coastguard Worker 90*61c4878aSAndroid Build Coastguard Worker def test_invalid_absolute_path_outside_env_returns_same_path(self): 91*61c4878aSAndroid Build Coastguard Worker executable_path = Path('/usr/bin/_pw_invalid_exe') 92*61c4878aSAndroid Build Coastguard Worker query_drivers = ['/**/*'] 93*61c4878aSAndroid Build Coastguard Worker result = path_to_executable( 94*61c4878aSAndroid Build Coastguard Worker str(executable_path.absolute()), path_globs=query_drivers 95*61c4878aSAndroid Build Coastguard Worker ) 96*61c4878aSAndroid Build Coastguard Worker self.assertIsNone(result) 97*61c4878aSAndroid Build Coastguard Worker 98*61c4878aSAndroid Build Coastguard Worker def test_invalid_relative_path_returns_same_path(self): 99*61c4878aSAndroid Build Coastguard Worker executable_path = Path('../_pw_invalid_exe') 100*61c4878aSAndroid Build Coastguard Worker query_drivers = [f'{self.temp_dir_path}/*'] 101*61c4878aSAndroid Build Coastguard Worker result = path_to_executable( 102*61c4878aSAndroid Build Coastguard Worker str(executable_path), path_globs=query_drivers 103*61c4878aSAndroid Build Coastguard Worker ) 104*61c4878aSAndroid Build Coastguard Worker self.assertIsNone(result) 105*61c4878aSAndroid Build Coastguard Worker 106*61c4878aSAndroid Build Coastguard Worker def test_invalid_no_path_returns_new_path(self): 107*61c4878aSAndroid Build Coastguard Worker executable_path = Path('_pw_invalid_exe') 108*61c4878aSAndroid Build Coastguard Worker query_drivers = [f'{self.temp_dir_path}/*'] 109*61c4878aSAndroid Build Coastguard Worker expected_path = self.temp_dir_path / executable_path 110*61c4878aSAndroid Build Coastguard Worker self.touch_temp_file(expected_path) 111*61c4878aSAndroid Build Coastguard Worker result = path_to_executable( 112*61c4878aSAndroid Build Coastguard Worker str(executable_path), path_globs=query_drivers 113*61c4878aSAndroid Build Coastguard Worker ) 114*61c4878aSAndroid Build Coastguard Worker self.assertIsNone(result) 115*61c4878aSAndroid Build Coastguard Worker 116*61c4878aSAndroid Build Coastguard Worker 117*61c4878aSAndroid Build Coastguard Workerclass TestInferTarget(unittest.TestCase): 118*61c4878aSAndroid Build Coastguard Worker """Tests infer_target""" 119*61c4878aSAndroid Build Coastguard Worker 120*61c4878aSAndroid Build Coastguard Worker def test_infer_target_pos(self): 121*61c4878aSAndroid Build Coastguard Worker test_cases = [ 122*61c4878aSAndroid Build Coastguard Worker ('?', [0]), 123*61c4878aSAndroid Build Coastguard Worker ('*/?', [1]), 124*61c4878aSAndroid Build Coastguard Worker ('*/*/?', [2]), 125*61c4878aSAndroid Build Coastguard Worker ('*/?/?', [1, 2]), 126*61c4878aSAndroid Build Coastguard Worker ] 127*61c4878aSAndroid Build Coastguard Worker 128*61c4878aSAndroid Build Coastguard Worker for glob, result in test_cases: 129*61c4878aSAndroid Build Coastguard Worker self.assertEqual(_infer_target_pos(glob), result) 130*61c4878aSAndroid Build Coastguard Worker 131*61c4878aSAndroid Build Coastguard Worker def test_infer_target(self): 132*61c4878aSAndroid Build Coastguard Worker test_cases = [ 133*61c4878aSAndroid Build Coastguard Worker ('?', 'target/thing.o', 'target'), 134*61c4878aSAndroid Build Coastguard Worker ('*/?', 'variants/target/foo/bar/thing.o', 'target'), 135*61c4878aSAndroid Build Coastguard Worker ('*/*/*/*/?', 'foo/bar/baz/hi/target/obj/thing.o', 'target'), 136*61c4878aSAndroid Build Coastguard Worker ('*/?/?', 'variants/target/foo/bar/thing.o', 'target_foo'), 137*61c4878aSAndroid Build Coastguard Worker ] 138*61c4878aSAndroid Build Coastguard Worker 139*61c4878aSAndroid Build Coastguard Worker for glob, output_path, result in test_cases: 140*61c4878aSAndroid Build Coastguard Worker self.assertEqual( 141*61c4878aSAndroid Build Coastguard Worker infer_target(glob, Path(''), Path(output_path)), result 142*61c4878aSAndroid Build Coastguard Worker ) 143*61c4878aSAndroid Build Coastguard Worker 144*61c4878aSAndroid Build Coastguard Worker 145*61c4878aSAndroid Build Coastguard Workerclass TestCppCompileCommand(PwIdeTestCase): 146*61c4878aSAndroid Build Coastguard Worker """Tests CppCompileCommand""" 147*61c4878aSAndroid Build Coastguard Worker 148*61c4878aSAndroid Build Coastguard Worker def run_process_test_with_valid_commands( 149*61c4878aSAndroid Build Coastguard Worker self, command: str, expected_executable: str | None 150*61c4878aSAndroid Build Coastguard Worker ) -> None: 151*61c4878aSAndroid Build Coastguard Worker compile_command = CppCompileCommand( 152*61c4878aSAndroid Build Coastguard Worker command=command, file='', directory='' 153*61c4878aSAndroid Build Coastguard Worker ) 154*61c4878aSAndroid Build Coastguard Worker processed_compile_command = cast( 155*61c4878aSAndroid Build Coastguard Worker CppCompileCommand, 156*61c4878aSAndroid Build Coastguard Worker compile_command.process(default_path=self.temp_dir_path), 157*61c4878aSAndroid Build Coastguard Worker ) 158*61c4878aSAndroid Build Coastguard Worker self.assertIsNotNone(processed_compile_command) 159*61c4878aSAndroid Build Coastguard Worker self.assertEqual( 160*61c4878aSAndroid Build Coastguard Worker processed_compile_command.executable_name, expected_executable 161*61c4878aSAndroid Build Coastguard Worker ) 162*61c4878aSAndroid Build Coastguard Worker 163*61c4878aSAndroid Build Coastguard Worker def run_process_test_with_invalid_commands(self, command: str) -> None: 164*61c4878aSAndroid Build Coastguard Worker compile_command = CppCompileCommand( 165*61c4878aSAndroid Build Coastguard Worker command=command, file='', directory='' 166*61c4878aSAndroid Build Coastguard Worker ) 167*61c4878aSAndroid Build Coastguard Worker 168*61c4878aSAndroid Build Coastguard Worker with self.assertRaises(UnresolvablePathException): 169*61c4878aSAndroid Build Coastguard Worker compile_command.process(default_path=self.temp_dir_path) 170*61c4878aSAndroid Build Coastguard Worker 171*61c4878aSAndroid Build Coastguard Worker def test_process_valid_with_gn_compile_command(self) -> None: 172*61c4878aSAndroid Build Coastguard Worker """Test output against typical GN-generated compile commands.""" 173*61c4878aSAndroid Build Coastguard Worker 174*61c4878aSAndroid Build Coastguard Worker cases: list[dict[str, str]] = [ 175*61c4878aSAndroid Build Coastguard Worker { 176*61c4878aSAndroid Build Coastguard Worker # pylint: disable=line-too-long 177*61c4878aSAndroid Build Coastguard Worker 'command': 'arm-none-eabi-g++ -MMD -MF stm32f429i_disc1_debug/obj/pw_allocator/block.block.cc.o.d -Wno-psabi -mabi=aapcs -mthumb --sysroot=../environment/cipd/packages/arm -specs=nano.specs -specs=nosys.specs -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Og -Wshadow -Wredundant-decls -u_printf_float -fdiagnostics-color -g -fno-common -fno-exceptions -ffunction-sections -fdata-sections -Wall -Wextra -Wimplicit-fallthrough -Wcast-qual -Wundef -Wpointer-arith -Werror -Wno-error=cpp -Wno-error=deprecated-declarations -ffile-prefix-map=/pigweed/pigweed/out=out -ffile-prefix-map=/pigweed/pigweed/= -ffile-prefix-map=../= -ffile-prefix-map=/pigweed/pigweed/out=out -fno-rtti -Wnon-virtual-dtor -std=c++17 -Wno-register -DPW_ARMV7M_ENABLE_FPU=1 -I../pw_allocator/public -I../pw_assert/public -I../pw_assert/assert_compatibility_public_overrides -I../pw_preprocessor/public -I../pw_assert_basic/public_overrides -I../pw_assert_basic/public -I../pw_span/public -I../pw_polyfill/public -I../pw_polyfill/standard_library_public -I../pw_status/public -c ../pw_allocator/block.cc -o stm32f429i_disc1_debug/obj/pw_allocator/block.block.cc.o', 178*61c4878aSAndroid Build Coastguard Worker # pylint: enable=line-too-long 179*61c4878aSAndroid Build Coastguard Worker 'executable': 'arm-none-eabi-g++', 180*61c4878aSAndroid Build Coastguard Worker }, 181*61c4878aSAndroid Build Coastguard Worker { 182*61c4878aSAndroid Build Coastguard Worker # pylint: disable=line-too-long 183*61c4878aSAndroid Build Coastguard Worker 'command': '../environment/cipd/packages/pigweed/bin/clang++ -MMD -MF pw_strict_host_clang_debug/obj/pw_allocator/block.block.cc.o.d -g3 --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -Og -Wshadow -Wredundant-decls -Wthread-safety -Wswitch-enum -fdiagnostics-color -g -fno-common -fno-exceptions -ffunction-sections -fdata-sections -Wall -Wextra -Wimplicit-fallthrough -Wcast-qual -Wundef -Wpointer-arith -Werror -Wno-error=cpp -Wno-error=deprecated-declarations -ffile-prefix-map=/pigweed/pigweed/out=out -ffile-prefix-map=/pigweed/pigweed/= -ffile-prefix-map=../= -ffile-prefix-map=/pigweed/pigweed/out=out -Wextra-semi -fno-rtti -Wnon-virtual-dtor -std=c++17 -Wno-register -D_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS=1 -DPW_STATUS_CFG_CHECK_IF_USED=1 -I../pw_allocator/public -I../pw_assert/public -I../pw_assert/print_and_abort_assert_public_overrides -I../pw_preprocessor/public -I../pw_assert_basic/public_overrides -I../pw_assert_basic/public -I../pw_span/public -I../pw_polyfill/public -I../pw_polyfill/standard_library_public -I../pw_status/public -c ../pw_allocator/block.cc -o pw_strict_host_clang_debug/obj/pw_allocator/block.block.cc.o', 184*61c4878aSAndroid Build Coastguard Worker # pylint: enable=line-too-long 185*61c4878aSAndroid Build Coastguard Worker 'executable': 'clang++', 186*61c4878aSAndroid Build Coastguard Worker }, 187*61c4878aSAndroid Build Coastguard Worker ] 188*61c4878aSAndroid Build Coastguard Worker 189*61c4878aSAndroid Build Coastguard Worker for case in cases: 190*61c4878aSAndroid Build Coastguard Worker self.run_process_test_with_valid_commands( 191*61c4878aSAndroid Build Coastguard Worker case['command'], case['executable'] 192*61c4878aSAndroid Build Coastguard Worker ) 193*61c4878aSAndroid Build Coastguard Worker 194*61c4878aSAndroid Build Coastguard Worker def test_process_invalid_with_gn_compile_command(self) -> None: 195*61c4878aSAndroid Build Coastguard Worker """Test output against typical GN-generated compile commands.""" 196*61c4878aSAndroid Build Coastguard Worker 197*61c4878aSAndroid Build Coastguard Worker # pylint: disable=line-too-long 198*61c4878aSAndroid Build Coastguard Worker command = "python ../pw_toolchain/py/pw_toolchain/clang_tidy.py --source-exclude 'third_party/.*' --source-exclude '.*packages/mbedtls.*' --source-exclude '.*packages/boringssl.*' --skip-include-path 'mbedtls/include' --skip-include-path 'mbedtls' --skip-include-path 'boringssl/src/include' --skip-include-path 'boringssl' --skip-include-path 'pw_tls_client/generate_test_data' --source-file ../pw_allocator/freelist.cc --source-root '../' --export-fixes pw_strict_host_clang_debug.static_analysis/obj/pw_allocator/freelist.freelist.cc.o.yaml -- ../environment/cipd/packages/pigweed/bin/clang++ END_OF_INVOKER -MMD -MF pw_strict_host_clang_debug.static_analysis/obj/pw_allocator/freelist.freelist.cc.o.d -g3 --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -Og -Wshadow -Wredundant-decls -Wthread-safety -Wswitch-enum -fdiagnostics-color -g -fno-common -fno-exceptions -ffunction-sections -fdata-sections -Wall -Wextra -Wimplicit-fallthrough -Wcast-qual -Wundef -Wpointer-arith -Werror -Wno-error=cpp -Wno-error=deprecated-declarations -ffile-prefix-map=/pigweed/pigweed/out=out -ffile-prefix-map=/pigweed/pigweed/= -ffile-prefix-map=../= -ffile-prefix-map=/pigweed/pigweed/out=out -Wextra-semi -fno-rtti -Wnon-virtual-dtor -std=c++17 -Wno-register -D_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS=1 -DPW_STATUS_CFG_CHECK_IF_USED=1 -I../pw_allocator/public -I../pw_containers/public -I../pw_assert/public -I../pw_assert/print_and_abort_assert_public_overrides -I../pw_preprocessor/public -I../pw_assert_basic/public_overrides -I../pw_assert_basic/public -I../pw_span/public -I../pw_polyfill/public -I../pw_polyfill/standard_library_public -I../pw_status/public -c ../pw_allocator/freelist.cc -o pw_strict_host_clang_debug.static_analysis/obj/pw_allocator/freelist.freelist.cc.o && touch pw_strict_host_clang_debug.static_analysis/obj/pw_allocator/freelist.freelist.cc.o" 199*61c4878aSAndroid Build Coastguard Worker # pylint: enable=line-too-long 200*61c4878aSAndroid Build Coastguard Worker 201*61c4878aSAndroid Build Coastguard Worker compile_command = CppCompileCommand( 202*61c4878aSAndroid Build Coastguard Worker command=command, file='', directory='' 203*61c4878aSAndroid Build Coastguard Worker ) 204*61c4878aSAndroid Build Coastguard Worker self.assertIsNone( 205*61c4878aSAndroid Build Coastguard Worker compile_command.process(default_path=self.temp_dir_path) 206*61c4878aSAndroid Build Coastguard Worker ) 207*61c4878aSAndroid Build Coastguard Worker 208*61c4878aSAndroid Build Coastguard Worker def test_process_unresolvable_with_gn_compile_command(self) -> None: 209*61c4878aSAndroid Build Coastguard Worker """Test output against typical GN-generated compile commands.""" 210*61c4878aSAndroid Build Coastguard Worker 211*61c4878aSAndroid Build Coastguard Worker # pylint: disable=line-too-long 212*61c4878aSAndroid Build Coastguard Worker command = 'clang++ -MMD -MF pw_strict_host_clang_debug/obj/pw_allocator/block.block.cc.o.d -g3 --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -Og -Wshadow -Wredundant-decls -Wthread-safety -Wswitch-enum -fdiagnostics-color -g -fno-common -fno-exceptions -ffunction-sections -fdata-sections -Wall -Wextra -Wimplicit-fallthrough -Wcast-qual -Wundef -Wpointer-arith -Werror -Wno-error=cpp -Wno-error=deprecated-declarations -ffile-prefix-map=/pigweed/pigweed/out=out -ffile-prefix-map=/pigweed/pigweed/= -ffile-prefix-map=../= -ffile-prefix-map=/pigweed/pigweed/out=out -Wextra-semi -fno-rtti -Wnon-virtual-dtor -std=c++17 -Wno-register -D_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS=1 -DPW_STATUS_CFG_CHECK_IF_USED=1 -I../pw_allocator/public -I../pw_assert/public -I../pw_assert/print_and_abort_assert_public_overrides -I../pw_preprocessor/public -I../pw_assert_basic/public_overrides -I../pw_assert_basic/public -I../pw_span/public -I../pw_polyfill/public -I../pw_polyfill/standard_library_public -I../pw_status/public -c ../pw_allocator/block.cc -o pw_strict_host_clang_debug/obj/pw_allocator/block.block.cc.o' 213*61c4878aSAndroid Build Coastguard Worker # pylint: enable=line-too-long 214*61c4878aSAndroid Build Coastguard Worker 215*61c4878aSAndroid Build Coastguard Worker compile_command = CppCompileCommand( 216*61c4878aSAndroid Build Coastguard Worker command=command, file='', directory='' 217*61c4878aSAndroid Build Coastguard Worker ) 218*61c4878aSAndroid Build Coastguard Worker 219*61c4878aSAndroid Build Coastguard Worker processed_compile_command = cast( 220*61c4878aSAndroid Build Coastguard Worker CppCompileCommand, compile_command.process() 221*61c4878aSAndroid Build Coastguard Worker ) 222*61c4878aSAndroid Build Coastguard Worker self.assertIsNotNone(processed_compile_command) 223*61c4878aSAndroid Build Coastguard Worker self.assertIsNotNone(processed_compile_command.command) 224*61c4878aSAndroid Build Coastguard Worker # .split() to avoid failing on whitespace differences. 225*61c4878aSAndroid Build Coastguard Worker self.assertCountEqual( 226*61c4878aSAndroid Build Coastguard Worker cast(str, processed_compile_command.command).split(), 227*61c4878aSAndroid Build Coastguard Worker command.split(), 228*61c4878aSAndroid Build Coastguard Worker ) 229*61c4878aSAndroid Build Coastguard Worker 230*61c4878aSAndroid Build Coastguard Worker def test_process_unresolvable_strict_with_gn_compile_command(self) -> None: 231*61c4878aSAndroid Build Coastguard Worker """Test output against typical GN-generated compile commands.""" 232*61c4878aSAndroid Build Coastguard Worker 233*61c4878aSAndroid Build Coastguard Worker # pylint: disable=line-too-long 234*61c4878aSAndroid Build Coastguard Worker command = 'clang++ -MMD -MF pw_strict_host_clang_debug/obj/pw_allocator/block.block.cc.o.d -g3 --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -Og -Wshadow -Wredundant-decls -Wthread-safety -Wswitch-enum -fdiagnostics-color -g -fno-common -fno-exceptions -ffunction-sections -fdata-sections -Wall -Wextra -Wimplicit-fallthrough -Wcast-qual -Wundef -Wpointer-arith -Werror -Wno-error=cpp -Wno-error=deprecated-declarations -ffile-prefix-map=/pigweed/pigweed/out=out -ffile-prefix-map=/pigweed/pigweed/= -ffile-prefix-map=../= -ffile-prefix-map=/pigweed/pigweed/out=out -Wextra-semi -fno-rtti -Wnon-virtual-dtor -std=c++17 -Wno-register -D_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS=1 -DPW_STATUS_CFG_CHECK_IF_USED=1 -I../pw_allocator/public -I../pw_assert/public -I../pw_assert/print_and_abort_assert_public_overrides -I../pw_preprocessor/public -I../pw_assert_basic/public_overrides -I../pw_assert_basic/public -I../pw_span/public -I../pw_polyfill/public -I../pw_polyfill/standard_library_public -I../pw_status/public -c ../pw_allocator/block.cc -o pw_strict_host_clang_debug/obj/pw_allocator/block.block.cc.o' 235*61c4878aSAndroid Build Coastguard Worker # pylint: enable=line-too-long 236*61c4878aSAndroid Build Coastguard Worker 237*61c4878aSAndroid Build Coastguard Worker compile_command = CppCompileCommand( 238*61c4878aSAndroid Build Coastguard Worker command=command, file='', directory='' 239*61c4878aSAndroid Build Coastguard Worker ) 240*61c4878aSAndroid Build Coastguard Worker 241*61c4878aSAndroid Build Coastguard Worker with self.assertRaises(UnresolvablePathException): 242*61c4878aSAndroid Build Coastguard Worker compile_command.process(strict=True) 243*61c4878aSAndroid Build Coastguard Worker 244*61c4878aSAndroid Build Coastguard Worker def test_process_blank_with_gn_compile_command(self) -> None: 245*61c4878aSAndroid Build Coastguard Worker """Test output against typical GN-generated compile commands.""" 246*61c4878aSAndroid Build Coastguard Worker 247*61c4878aSAndroid Build Coastguard Worker command = '' 248*61c4878aSAndroid Build Coastguard Worker compile_command = CppCompileCommand( 249*61c4878aSAndroid Build Coastguard Worker command=command, file='', directory='' 250*61c4878aSAndroid Build Coastguard Worker ) 251*61c4878aSAndroid Build Coastguard Worker 252*61c4878aSAndroid Build Coastguard Worker result = compile_command.process(default_path=self.temp_dir_path) 253*61c4878aSAndroid Build Coastguard Worker self.assertIsNone(result) 254*61c4878aSAndroid Build Coastguard Worker 255*61c4878aSAndroid Build Coastguard Worker 256*61c4878aSAndroid Build Coastguard Workerclass TestCommandParts(unittest.TestCase): 257*61c4878aSAndroid Build Coastguard Worker """Test command_parts""" 258*61c4878aSAndroid Build Coastguard Worker 259*61c4878aSAndroid Build Coastguard Worker def test_command_parts(self): 260*61c4878aSAndroid Build Coastguard Worker """Test command_parts""" 261*61c4878aSAndroid Build Coastguard Worker 262*61c4878aSAndroid Build Coastguard Worker # pylint: disable=line-too-long 263*61c4878aSAndroid Build Coastguard Worker test_cases = [ 264*61c4878aSAndroid Build Coastguard Worker "python ../pw_toolchain/py/pw_toolchain/clang_tidy.py --source-exclude 'third_party/.*' --source-exclude '.*packages/mbedtls.*' --source-exclude '.*packages/boringssl.*' --skip-include-path 'mbedtls/include' --skip-include-path 'mbedtls' --skip-include-path 'boringssl/src/include' --skip-include-path 'boringssl' --skip-include-path 'pw_tls_client/generate_test_data' --source-file ../pw_allocator/block.cc --source-root '../' --export-fixes pw_strict_host_clang_debug.static_analysis/obj/pw_allocator/block.block.cc.o.yaml -- ../environment/cipd/packages/pigweed/bin/clang++ END_OF_INVOKER -MMD -MF pw_strict_host_clang_debug.static_analysis/obj/pw_allocator/block.block.cc.o.d -g3 --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -Og -Wshadow -Wredundant-decls -Wthread-safety -Wswitch-enum -fdiagnostics-color -g -fno-common -fno-exceptions -ffunction-sections -fdata-sections -Wall -Wextra -Wimplicit-fallthrough -Wcast-qual -Wundef -Wpointer-arith -Werror -Wno-error=cpp -Wno-error=deprecated-declarations -ffile-prefix-map=/pigweed/pigweed/out=out -ffile-prefix-map=/pigweed/pigweed/= -ffile-prefix-map=../= -ffile-prefix-map=/pigweed/pigweed/out=out -Wextra-semi -fno-rtti -Wnon-virtual-dtor -std=c++17 -Wno-register -D_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS=1 -DPW_STATUS_CFG_CHECK_IF_USED=1 -I../pw_allocator/public -I../pw_assert/public -I../pw_assert/print_and_abort_assert_public_overrides -I../pw_preprocessor/public -I../pw_assert_basic/public_overrides -I../pw_assert_basic/public -I../pw_span/public -I../pw_polyfill/public -I../pw_polyfill/standard_library_public -I../pw_status/public -c ../pw_allocator/block.cc -o pw_strict_host_clang_debug.static_analysis/obj/pw_allocator/block.block.cc.o && touch pw_strict_host_clang_debug.static_analysis/obj/pw_allocator/block.block.cc.o", 265*61c4878aSAndroid Build Coastguard Worker 'arm-none-eabi-g++ -MMD -MF stm32f429i_disc1_debug/obj/pw_allocator/block.block.cc.o.d -Wno-psabi -mabi=aapcs -mthumb --sysroot=../environment/cipd/packages/arm -specs=nano.specs -specs=nosys.specs -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Og -Wshadow -Wredundant-decls -u_printf_float -fdiagnostics-color -g -fno-common -fno-exceptions -ffunction-sections -fdata-sections -Wall -Wextra -Wimplicit-fallthrough -Wcast-qual -Wundef -Wpointer-arith -Werror -Wno-error=cpp -Wno-error=deprecated-declarations -ffile-prefix-map=/pigweed/pigweed/out=out -ffile-prefix-map=/pigweed/pigweed/= -ffile-prefix-map=../= -ffile-prefix-map=/pigweed/pigweed/out=out -fno-rtti -Wnon-virtual-dtor -std=c++17 -Wno-register -DPW_ARMV7M_ENABLE_FPU=1 -I../pw_allocator/public -I../pw_assert/public -I../pw_assert/assert_compatibility_public_overrides -I../pw_preprocessor/public -I../pw_assert_basic/public_overrides -I../pw_assert_basic/public -I../pw_span/public -I../pw_polyfill/public -I../pw_polyfill/standard_library_public -I../pw_status/public -c ../pw_allocator/block.cc -o stm32f429i_disc1_debug/obj/pw_allocator/block.block.cc.o', 266*61c4878aSAndroid Build Coastguard Worker '../environment/cipd/packages/pigweed/bin/isosceles-clang++ -MMD -MF isosceles_debug/obj/pw_allocator/block.block.cc.o.d -g3 --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -Og -Wshadow -Wredundant-decls -Wthread-safety -Wswitch-enum -fdiagnostics-color -g -fno-common -fno-exceptions -ffunction-sections -fdata-sections -Wall -Wextra -Wimplicit-fallthrough -Wcast-qual -Wundef -Wpointer-arith -Werror -Wno-error=cpp -Wno-error=deprecated-declarations -ffile-prefix-map=/pigweed/pigweed/out=out -ffile-prefix-map=/pigweed/pigweed/= -ffile-prefix-map=../= -ffile-prefix-map=/pigweed/pigweed/out=out -Wextra-semi -fno-rtti -Wnon-virtual-dtor -std=c++17 -Wno-register -D_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS=1 -DPW_STATUS_CFG_CHECK_IF_USED=1 -I../pw_allocator/public -I../pw_assert/public -I../pw_assert/print_and_abort_assert_public_overrides -I../pw_preprocessor/public -I../pw_assert_basic/public_overrides -I../pw_assert_basic/public -I../pw_span/public -I../pw_polyfill/public -I../pw_polyfill/standard_library_public -I../pw_status/public -c ../pw_allocator/block.cc -o isosceles_debug/obj/pw_allocator/block.block.cc.o', 267*61c4878aSAndroid Build Coastguard Worker '../environment/cipd/packages/pigweed/bin/clang++ -MMD -MF pw_strict_host_clang_debug/obj/pw_allocator/block.block.cc.o.d -g3 --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -Og -Wshadow -Wredundant-decls -Wthread-safety -Wswitch-enum -fdiagnostics-color -g -fno-common -fno-exceptions -ffunction-sections -fdata-sections -Wall -Wextra -Wimplicit-fallthrough -Wcast-qual -Wundef -Wpointer-arith -Werror -Wno-error=cpp -Wno-error=deprecated-declarations -ffile-prefix-map=/pigweed/pigweed/out=out -ffile-prefix-map=/pigweed/pigweed/= -ffile-prefix-map=../= -ffile-prefix-map=/pigweed/pigweed/out=out -Wextra-semi -fno-rtti -Wnon-virtual-dtor -std=c++17 -Wno-register -D_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS=1 -DPW_STATUS_CFG_CHECK_IF_USED=1 -I../pw_allocator/public -I../pw_assert/public -I../pw_assert/print_and_abort_assert_public_overrides -I../pw_preprocessor/public -I../pw_assert_basic/public_overrides -I../pw_assert_basic/public -I../pw_span/public -I../pw_polyfill/public -I../pw_polyfill/standard_library_public -I../pw_status/public -c ../pw_allocator/block.cc -o pw_strict_host_clang_debug/obj/pw_allocator/block.block.cc.o', 268*61c4878aSAndroid Build Coastguard Worker 'ccache arm-none-eabi-g++ -MMD -MF stm32f429i_disc1_debug/obj/pw_allocator/block.block.cc.o.d -Wno-psabi -mabi=aapcs -mthumb --sysroot=../environment/cipd/packages/arm -specs=nano.specs -specs=nosys.specs -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Og -Wshadow -Wredundant-decls -u_printf_float -fdiagnostics-color -g -fno-common -fno-exceptions -ffunction-sections -fdata-sections -Wall -Wextra -Wimplicit-fallthrough -Wcast-qual -Wundef -Wpointer-arith -Werror -Wno-error=cpp -Wno-error=deprecated-declarations -ffile-prefix-map=/pigweed/pigweed/out=out -ffile-prefix-map=/pigweed/pigweed/= -ffile-prefix-map=../= -ffile-prefix-map=/pigweed/pigweed/out=out -fno-rtti -Wnon-virtual-dtor -std=c++17 -Wno-register -DPW_ARMV7M_ENABLE_FPU=1 -I../pw_allocator/public -I../pw_assert/public -I../pw_assert/assert_compatibility_public_overrides -I../pw_preprocessor/public -I../pw_assert_basic/public_overrides -I../pw_assert_basic/public -I../pw_span/public -I../pw_polyfill/public -I../pw_polyfill/standard_library_public -I../pw_status/public -c ../pw_allocator/block.cc -o stm32f429i_disc1_debug/obj/pw_allocator/block.block.cc.o', 269*61c4878aSAndroid Build Coastguard Worker 'ccache ../environment/cipd/packages/pigweed/bin/isosceles-clang++ -MMD -MF isosceles_debug/obj/pw_allocator/block.block.cc.o.d -g3 --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -Og -Wshadow -Wredundant-decls -Wthread-safety -Wswitch-enum -fdiagnostics-color -g -fno-common -fno-exceptions -ffunction-sections -fdata-sections -Wall -Wextra -Wimplicit-fallthrough -Wcast-qual -Wundef -Wpointer-arith -Werror -Wno-error=cpp -Wno-error=deprecated-declarations -ffile-prefix-map=/pigweed/pigweed/out=out -ffile-prefix-map=/pigweed/pigweed/= -ffile-prefix-map=../= -ffile-prefix-map=/pigweed/pigweed/out=out -Wextra-semi -fno-rtti -Wnon-virtual-dtor -std=c++17 -Wno-register -D_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS=1 -DPW_STATUS_CFG_CHECK_IF_USED=1 -I../pw_allocator/public -I../pw_assert/public -I../pw_assert/print_and_abort_assert_public_overrides -I../pw_preprocessor/public -I../pw_assert_basic/public_overrides -I../pw_assert_basic/public -I../pw_span/public -I../pw_polyfill/public -I../pw_polyfill/standard_library_public -I../pw_status/public -c ../pw_allocator/block.cc -o isosceles_debug/obj/pw_allocator/block.block.cc.o', 270*61c4878aSAndroid Build Coastguard Worker 'ccache ../environment/cipd/packages/pigweed/bin/clang++ -MMD -MF pw_strict_host_clang_debug/obj/pw_allocator/block.block.cc.o.d -g3 --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -Og -Wshadow -Wredundant-decls -Wthread-safety -Wswitch-enum -fdiagnostics-color -g -fno-common -fno-exceptions -ffunction-sections -fdata-sections -Wall -Wextra -Wimplicit-fallthrough -Wcast-qual -Wundef -Wpointer-arith -Werror -Wno-error=cpp -Wno-error=deprecated-declarations -ffile-prefix-map=/pigweed/pigweed/out=out -ffile-prefix-map=/pigweed/pigweed/= -ffile-prefix-map=../= -ffile-prefix-map=/pigweed/pigweed/out=out -Wextra-semi -fno-rtti -Wnon-virtual-dtor -std=c++17 -Wno-register -D_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS=1 -DPW_STATUS_CFG_CHECK_IF_USED=1 -I../pw_allocator/public -I../pw_assert/public -I../pw_assert/print_and_abort_assert_public_overrides -I../pw_preprocessor/public -I../pw_assert_basic/public_overrides -I../pw_assert_basic/public -I../pw_span/public -I../pw_polyfill/public -I../pw_polyfill/standard_library_public -I../pw_status/public -c ../pw_allocator/block.cc -o pw_strict_host_clang_debug/obj/pw_allocator/block.block.cc.o', 271*61c4878aSAndroid Build Coastguard Worker 'ccache debug=true max_size=10G arm-none-eabi-g++ -MMD -MF stm32f429i_disc1_debug/obj/pw_allocator/block.block.cc.o.d -Wno-psabi -mabi=aapcs -mthumb --sysroot=../environment/cipd/packages/arm -specs=nano.specs -specs=nosys.specs -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Og -Wshadow -Wredundant-decls -u_printf_float -fdiagnostics-color -g -fno-common -fno-exceptions -ffunction-sections -fdata-sections -Wall -Wextra -Wimplicit-fallthrough -Wcast-qual -Wundef -Wpointer-arith -Werror -Wno-error=cpp -Wno-error=deprecated-declarations -ffile-prefix-map=/pigweed/pigweed/out=out -ffile-prefix-map=/pigweed/pigweed/= -ffile-prefix-map=../= -ffile-prefix-map=/pigweed/pigweed/out=out -fno-rtti -Wnon-virtual-dtor -std=c++17 -Wno-register -DPW_ARMV7M_ENABLE_FPU=1 -I../pw_allocator/public -I../pw_assert/public -I../pw_assert/assert_compatibility_public_overrides -I../pw_preprocessor/public -I../pw_assert_basic/public_overrides -I../pw_assert_basic/public -I../pw_span/public -I../pw_polyfill/public -I../pw_polyfill/standard_library_public -I../pw_status/public -c ../pw_allocator/block.cc -o stm32f429i_disc1_debug/obj/pw_allocator/block.block.cc.o', 272*61c4878aSAndroid Build Coastguard Worker 'ccache debug=true max_size=10G ../environment/cipd/packages/pigweed/bin/isosceles-clang++ -MMD -MF isosceles_debug/obj/pw_allocator/block.block.cc.o.d -g3 --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -Og -Wshadow -Wredundant-decls -Wthread-safety -Wswitch-enum -fdiagnostics-color -g -fno-common -fno-exceptions -ffunction-sections -fdata-sections -Wall -Wextra -Wimplicit-fallthrough -Wcast-qual -Wundef -Wpointer-arith -Werror -Wno-error=cpp -Wno-error=deprecated-declarations -ffile-prefix-map=/pigweed/pigweed/out=out -ffile-prefix-map=/pigweed/pigweed/= -ffile-prefix-map=../= -ffile-prefix-map=/pigweed/pigweed/out=out -Wextra-semi -fno-rtti -Wnon-virtual-dtor -std=c++17 -Wno-register -D_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS=1 -DPW_STATUS_CFG_CHECK_IF_USED=1 -I../pw_allocator/public -I../pw_assert/public -I../pw_assert/print_and_abort_assert_public_overrides -I../pw_preprocessor/public -I../pw_assert_basic/public_overrides -I../pw_assert_basic/public -I../pw_span/public -I../pw_polyfill/public -I../pw_polyfill/standard_library_public -I../pw_status/public -c ../pw_allocator/block.cc -o isosceles_debug/obj/pw_allocator/block.block.cc.o', 273*61c4878aSAndroid Build Coastguard Worker 'ccache debug=true max_size=10G ../environment/cipd/packages/pigweed/bin/clang++ -MMD -MF pw_strict_host_clang_debug/obj/pw_allocator/block.block.cc.o.d -g3 --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -Og -Wshadow -Wredundant-decls -Wthread-safety -Wswitch-enum -fdiagnostics-color -g -fno-common -fno-exceptions -ffunction-sections -fdata-sections -Wall -Wextra -Wimplicit-fallthrough -Wcast-qual -Wundef -Wpointer-arith -Werror -Wno-error=cpp -Wno-error=deprecated-declarations -ffile-prefix-map=/pigweed/pigweed/out=out -ffile-prefix-map=/pigweed/pigweed/= -ffile-prefix-map=../= -ffile-prefix-map=/pigweed/pigweed/out=out -Wextra-semi -fno-rtti -Wnon-virtual-dtor -std=c++17 -Wno-register -D_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS=1 -DPW_STATUS_CFG_CHECK_IF_USED=1 -I../pw_allocator/public -I../pw_assert/public -I../pw_assert/print_and_abort_assert_public_overrides -I../pw_preprocessor/public -I../pw_assert_basic/public_overrides -I../pw_assert_basic/public -I../pw_span/public -I../pw_polyfill/public -I../pw_polyfill/standard_library_public -I../pw_status/public -c ../pw_allocator/block.cc -o pw_strict_host_clang_debug/obj/pw_allocator/block.block.cc.o', 274*61c4878aSAndroid Build Coastguard Worker "ccache python ../pw_toolchain/py/pw_toolchain/clang_tidy.py --source-exclude 'third_party/.*' --source-exclude '.*packages/mbedtls.*' --source-exclude '.*packages/boringssl.*' --skip-include-path 'mbedtls/include' --skip-include-path 'mbedtls' --skip-include-path 'boringssl/src/include' --skip-include-path 'boringssl' --skip-include-path 'pw_tls_client/generate_test_data' --source-file ../pw_allocator/block.cc --source-root '../' --export-fixes pw_strict_host_clang_debug.static_analysis/obj/pw_allocator/block.block.cc.o.yaml -- ../environment/cipd/packages/pigweed/bin/clang++ END_OF_INVOKER -MMD -MF pw_strict_host_clang_debug.static_analysis/obj/pw_allocator/block.block.cc.o.d -g3 --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -Og -Wshadow -Wredundant-decls -Wthread-safety -Wswitch-enum -fdiagnostics-color -g -fno-common -fno-exceptions -ffunction-sections -fdata-sections -Wall -Wextra -Wimplicit-fallthrough -Wcast-qual -Wundef -Wpointer-arith -Werror -Wno-error=cpp -Wno-error=deprecated-declarations -ffile-prefix-map=/pigweed/pigweed/out=out -ffile-prefix-map=/pigweed/pigweed/= -ffile-prefix-map=../= -ffile-prefix-map=/pigweed/pigweed/out=out -Wextra-semi -fno-rtti -Wnon-virtual-dtor -std=c++17 -Wno-register -D_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS=1 -DPW_STATUS_CFG_CHECK_IF_USED=1 -I../pw_allocator/public -I../pw_assert/public -I../pw_assert/print_and_abort_assert_public_overrides -I../pw_preprocessor/public -I../pw_assert_basic/public_overrides -I../pw_assert_basic/public -I../pw_span/public -I../pw_polyfill/public -I../pw_polyfill/standard_library_public -I../pw_status/public -c ../pw_allocator/block.cc -o pw_strict_host_clang_debug.static_analysis/obj/pw_allocator/block.block.cc.o && touch pw_strict_host_clang_debug.static_analysis/obj/pw_allocator/block.block.cc.o", 275*61c4878aSAndroid Build Coastguard Worker ] 276*61c4878aSAndroid Build Coastguard Worker 277*61c4878aSAndroid Build Coastguard Worker expected_results = [ 278*61c4878aSAndroid Build Coastguard Worker ( 279*61c4878aSAndroid Build Coastguard Worker None, 280*61c4878aSAndroid Build Coastguard Worker 'python', 281*61c4878aSAndroid Build Coastguard Worker [ 282*61c4878aSAndroid Build Coastguard Worker '../pw_toolchain/py/pw_toolchain/clang_tidy.py', 283*61c4878aSAndroid Build Coastguard Worker '--source-exclude', 284*61c4878aSAndroid Build Coastguard Worker "'third_party/.*'", 285*61c4878aSAndroid Build Coastguard Worker '--source-exclude', 286*61c4878aSAndroid Build Coastguard Worker "'.*packages/mbedtls.*'", 287*61c4878aSAndroid Build Coastguard Worker '--source-exclude', 288*61c4878aSAndroid Build Coastguard Worker "'.*packages/boringssl.*'", 289*61c4878aSAndroid Build Coastguard Worker '--skip-include-path', 290*61c4878aSAndroid Build Coastguard Worker "'mbedtls/include'", 291*61c4878aSAndroid Build Coastguard Worker '--skip-include-path', 292*61c4878aSAndroid Build Coastguard Worker "'mbedtls'", 293*61c4878aSAndroid Build Coastguard Worker '--skip-include-path', 294*61c4878aSAndroid Build Coastguard Worker "'boringssl/src/include'", 295*61c4878aSAndroid Build Coastguard Worker '--skip-include-path', 296*61c4878aSAndroid Build Coastguard Worker "'boringssl'", 297*61c4878aSAndroid Build Coastguard Worker '--skip-include-path', 298*61c4878aSAndroid Build Coastguard Worker "'pw_tls_client/generate_test_data'", 299*61c4878aSAndroid Build Coastguard Worker '--source-file', 300*61c4878aSAndroid Build Coastguard Worker '../pw_allocator/block.cc', 301*61c4878aSAndroid Build Coastguard Worker '--source-root', 302*61c4878aSAndroid Build Coastguard Worker "'../'", 303*61c4878aSAndroid Build Coastguard Worker '--export-fixes', 304*61c4878aSAndroid Build Coastguard Worker 'pw_strict_host_clang_debug.static_analysis/obj/pw_allocator/block.block.cc.o.yaml', 305*61c4878aSAndroid Build Coastguard Worker '--', 306*61c4878aSAndroid Build Coastguard Worker '../environment/cipd/packages/pigweed/bin/clang++', 307*61c4878aSAndroid Build Coastguard Worker 'END_OF_INVOKER', 308*61c4878aSAndroid Build Coastguard Worker '-MMD', 309*61c4878aSAndroid Build Coastguard Worker '-MF', 310*61c4878aSAndroid Build Coastguard Worker 'pw_strict_host_clang_debug.static_analysis/obj/pw_allocator/block.block.cc.o.d', 311*61c4878aSAndroid Build Coastguard Worker '-g3', 312*61c4878aSAndroid Build Coastguard Worker '--sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk', 313*61c4878aSAndroid Build Coastguard Worker '-Og', 314*61c4878aSAndroid Build Coastguard Worker '-Wshadow', 315*61c4878aSAndroid Build Coastguard Worker '-Wredundant-decls', 316*61c4878aSAndroid Build Coastguard Worker '-Wthread-safety', 317*61c4878aSAndroid Build Coastguard Worker '-Wswitch-enum', 318*61c4878aSAndroid Build Coastguard Worker '-fdiagnostics-color', 319*61c4878aSAndroid Build Coastguard Worker '-g', 320*61c4878aSAndroid Build Coastguard Worker '-fno-common', 321*61c4878aSAndroid Build Coastguard Worker '-fno-exceptions', 322*61c4878aSAndroid Build Coastguard Worker '-ffunction-sections', 323*61c4878aSAndroid Build Coastguard Worker '-fdata-sections', 324*61c4878aSAndroid Build Coastguard Worker '-Wall', 325*61c4878aSAndroid Build Coastguard Worker '-Wextra', 326*61c4878aSAndroid Build Coastguard Worker '-Wimplicit-fallthrough', 327*61c4878aSAndroid Build Coastguard Worker '-Wcast-qual', 328*61c4878aSAndroid Build Coastguard Worker '-Wundef', 329*61c4878aSAndroid Build Coastguard Worker '-Wpointer-arith', 330*61c4878aSAndroid Build Coastguard Worker '-Werror', 331*61c4878aSAndroid Build Coastguard Worker '-Wno-error=cpp', 332*61c4878aSAndroid Build Coastguard Worker '-Wno-error=deprecated-declarations', 333*61c4878aSAndroid Build Coastguard Worker '-ffile-prefix-map=/pigweed/pigweed/out=out', 334*61c4878aSAndroid Build Coastguard Worker '-ffile-prefix-map=/pigweed/pigweed/=', 335*61c4878aSAndroid Build Coastguard Worker '-ffile-prefix-map=../=', 336*61c4878aSAndroid Build Coastguard Worker '-ffile-prefix-map=/pigweed/pigweed/out=out', 337*61c4878aSAndroid Build Coastguard Worker '-Wextra-semi', 338*61c4878aSAndroid Build Coastguard Worker '-fno-rtti', 339*61c4878aSAndroid Build Coastguard Worker '-Wnon-virtual-dtor', 340*61c4878aSAndroid Build Coastguard Worker '-std=c++17', 341*61c4878aSAndroid Build Coastguard Worker '-Wno-register', 342*61c4878aSAndroid Build Coastguard Worker '-D_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS=1', 343*61c4878aSAndroid Build Coastguard Worker '-DPW_STATUS_CFG_CHECK_IF_USED=1', 344*61c4878aSAndroid Build Coastguard Worker '-I../pw_allocator/public', 345*61c4878aSAndroid Build Coastguard Worker '-I../pw_assert/public', 346*61c4878aSAndroid Build Coastguard Worker '-I../pw_assert/print_and_abort_assert_public_overrides', 347*61c4878aSAndroid Build Coastguard Worker '-I../pw_preprocessor/public', 348*61c4878aSAndroid Build Coastguard Worker '-I../pw_assert_basic/public_overrides', 349*61c4878aSAndroid Build Coastguard Worker '-I../pw_assert_basic/public', 350*61c4878aSAndroid Build Coastguard Worker '-I../pw_span/public', 351*61c4878aSAndroid Build Coastguard Worker '-I../pw_polyfill/public', 352*61c4878aSAndroid Build Coastguard Worker '-I../pw_polyfill/standard_library_public', 353*61c4878aSAndroid Build Coastguard Worker '-I../pw_status/public', 354*61c4878aSAndroid Build Coastguard Worker '-c', 355*61c4878aSAndroid Build Coastguard Worker '../pw_allocator/block.cc', 356*61c4878aSAndroid Build Coastguard Worker '-o', 357*61c4878aSAndroid Build Coastguard Worker 'pw_strict_host_clang_debug.static_analysis/obj/pw_allocator/block.block.cc.o', 358*61c4878aSAndroid Build Coastguard Worker '&&', 359*61c4878aSAndroid Build Coastguard Worker 'touch', 360*61c4878aSAndroid Build Coastguard Worker 'pw_strict_host_clang_debug.static_analysis/obj/pw_allocator/block.block.cc.o', 361*61c4878aSAndroid Build Coastguard Worker ], 362*61c4878aSAndroid Build Coastguard Worker ), 363*61c4878aSAndroid Build Coastguard Worker ( 364*61c4878aSAndroid Build Coastguard Worker None, 365*61c4878aSAndroid Build Coastguard Worker 'arm-none-eabi-g++', 366*61c4878aSAndroid Build Coastguard Worker [ 367*61c4878aSAndroid Build Coastguard Worker '-MMD', 368*61c4878aSAndroid Build Coastguard Worker '-MF', 369*61c4878aSAndroid Build Coastguard Worker 'stm32f429i_disc1_debug/obj/pw_allocator/block.block.cc.o.d', 370*61c4878aSAndroid Build Coastguard Worker '-Wno-psabi', 371*61c4878aSAndroid Build Coastguard Worker '-mabi=aapcs', 372*61c4878aSAndroid Build Coastguard Worker '-mthumb', 373*61c4878aSAndroid Build Coastguard Worker '--sysroot=../environment/cipd/packages/arm', 374*61c4878aSAndroid Build Coastguard Worker '-specs=nano.specs', 375*61c4878aSAndroid Build Coastguard Worker '-specs=nosys.specs', 376*61c4878aSAndroid Build Coastguard Worker '-mcpu=cortex-m4', 377*61c4878aSAndroid Build Coastguard Worker '-mfloat-abi=hard', 378*61c4878aSAndroid Build Coastguard Worker '-mfpu=fpv4-sp-d16', 379*61c4878aSAndroid Build Coastguard Worker '-Og', 380*61c4878aSAndroid Build Coastguard Worker '-Wshadow', 381*61c4878aSAndroid Build Coastguard Worker '-Wredundant-decls', 382*61c4878aSAndroid Build Coastguard Worker '-u_printf_float', 383*61c4878aSAndroid Build Coastguard Worker '-fdiagnostics-color', 384*61c4878aSAndroid Build Coastguard Worker '-g', 385*61c4878aSAndroid Build Coastguard Worker '-fno-common', 386*61c4878aSAndroid Build Coastguard Worker '-fno-exceptions', 387*61c4878aSAndroid Build Coastguard Worker '-ffunction-sections', 388*61c4878aSAndroid Build Coastguard Worker '-fdata-sections', 389*61c4878aSAndroid Build Coastguard Worker '-Wall', 390*61c4878aSAndroid Build Coastguard Worker '-Wextra', 391*61c4878aSAndroid Build Coastguard Worker '-Wimplicit-fallthrough', 392*61c4878aSAndroid Build Coastguard Worker '-Wcast-qual', 393*61c4878aSAndroid Build Coastguard Worker '-Wundef', 394*61c4878aSAndroid Build Coastguard Worker '-Wpointer-arith', 395*61c4878aSAndroid Build Coastguard Worker '-Werror', 396*61c4878aSAndroid Build Coastguard Worker '-Wno-error=cpp', 397*61c4878aSAndroid Build Coastguard Worker '-Wno-error=deprecated-declarations', 398*61c4878aSAndroid Build Coastguard Worker '-ffile-prefix-map=/pigweed/pigweed/out=out', 399*61c4878aSAndroid Build Coastguard Worker '-ffile-prefix-map=/pigweed/pigweed/=', 400*61c4878aSAndroid Build Coastguard Worker '-ffile-prefix-map=../=', 401*61c4878aSAndroid Build Coastguard Worker '-ffile-prefix-map=/pigweed/pigweed/out=out', 402*61c4878aSAndroid Build Coastguard Worker '-fno-rtti', 403*61c4878aSAndroid Build Coastguard Worker '-Wnon-virtual-dtor', 404*61c4878aSAndroid Build Coastguard Worker '-std=c++17', 405*61c4878aSAndroid Build Coastguard Worker '-Wno-register', 406*61c4878aSAndroid Build Coastguard Worker '-DPW_ARMV7M_ENABLE_FPU=1', 407*61c4878aSAndroid Build Coastguard Worker '-I../pw_allocator/public', 408*61c4878aSAndroid Build Coastguard Worker '-I../pw_assert/public', 409*61c4878aSAndroid Build Coastguard Worker '-I../pw_assert/assert_compatibility_public_overrides', 410*61c4878aSAndroid Build Coastguard Worker '-I../pw_preprocessor/public', 411*61c4878aSAndroid Build Coastguard Worker '-I../pw_assert_basic/public_overrides', 412*61c4878aSAndroid Build Coastguard Worker '-I../pw_assert_basic/public', 413*61c4878aSAndroid Build Coastguard Worker '-I../pw_span/public', 414*61c4878aSAndroid Build Coastguard Worker '-I../pw_polyfill/public', 415*61c4878aSAndroid Build Coastguard Worker '-I../pw_polyfill/standard_library_public', 416*61c4878aSAndroid Build Coastguard Worker '-I../pw_status/public', 417*61c4878aSAndroid Build Coastguard Worker '-c', 418*61c4878aSAndroid Build Coastguard Worker '../pw_allocator/block.cc', 419*61c4878aSAndroid Build Coastguard Worker '-o', 420*61c4878aSAndroid Build Coastguard Worker 'stm32f429i_disc1_debug/obj/pw_allocator/block.block.cc.o', 421*61c4878aSAndroid Build Coastguard Worker ], 422*61c4878aSAndroid Build Coastguard Worker ), 423*61c4878aSAndroid Build Coastguard Worker ( 424*61c4878aSAndroid Build Coastguard Worker None, 425*61c4878aSAndroid Build Coastguard Worker '../environment/cipd/packages/pigweed/bin/isosceles-clang++', 426*61c4878aSAndroid Build Coastguard Worker [ 427*61c4878aSAndroid Build Coastguard Worker '-MMD', 428*61c4878aSAndroid Build Coastguard Worker '-MF', 429*61c4878aSAndroid Build Coastguard Worker 'isosceles_debug/obj/pw_allocator/block.block.cc.o.d', 430*61c4878aSAndroid Build Coastguard Worker '-g3', 431*61c4878aSAndroid Build Coastguard Worker '--sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk', 432*61c4878aSAndroid Build Coastguard Worker '-Og', 433*61c4878aSAndroid Build Coastguard Worker '-Wshadow', 434*61c4878aSAndroid Build Coastguard Worker '-Wredundant-decls', 435*61c4878aSAndroid Build Coastguard Worker '-Wthread-safety', 436*61c4878aSAndroid Build Coastguard Worker '-Wswitch-enum', 437*61c4878aSAndroid Build Coastguard Worker '-fdiagnostics-color', 438*61c4878aSAndroid Build Coastguard Worker '-g', 439*61c4878aSAndroid Build Coastguard Worker '-fno-common', 440*61c4878aSAndroid Build Coastguard Worker '-fno-exceptions', 441*61c4878aSAndroid Build Coastguard Worker '-ffunction-sections', 442*61c4878aSAndroid Build Coastguard Worker '-fdata-sections', 443*61c4878aSAndroid Build Coastguard Worker '-Wall', 444*61c4878aSAndroid Build Coastguard Worker '-Wextra', 445*61c4878aSAndroid Build Coastguard Worker '-Wimplicit-fallthrough', 446*61c4878aSAndroid Build Coastguard Worker '-Wcast-qual', 447*61c4878aSAndroid Build Coastguard Worker '-Wundef', 448*61c4878aSAndroid Build Coastguard Worker '-Wpointer-arith', 449*61c4878aSAndroid Build Coastguard Worker '-Werror', 450*61c4878aSAndroid Build Coastguard Worker '-Wno-error=cpp', 451*61c4878aSAndroid Build Coastguard Worker '-Wno-error=deprecated-declarations', 452*61c4878aSAndroid Build Coastguard Worker '-ffile-prefix-map=/pigweed/pigweed/out=out', 453*61c4878aSAndroid Build Coastguard Worker '-ffile-prefix-map=/pigweed/pigweed/=', 454*61c4878aSAndroid Build Coastguard Worker '-ffile-prefix-map=../=', 455*61c4878aSAndroid Build Coastguard Worker '-ffile-prefix-map=/pigweed/pigweed/out=out', 456*61c4878aSAndroid Build Coastguard Worker '-Wextra-semi', 457*61c4878aSAndroid Build Coastguard Worker '-fno-rtti', 458*61c4878aSAndroid Build Coastguard Worker '-Wnon-virtual-dtor', 459*61c4878aSAndroid Build Coastguard Worker '-std=c++17', 460*61c4878aSAndroid Build Coastguard Worker '-Wno-register', 461*61c4878aSAndroid Build Coastguard Worker '-D_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS=1', 462*61c4878aSAndroid Build Coastguard Worker '-DPW_STATUS_CFG_CHECK_IF_USED=1', 463*61c4878aSAndroid Build Coastguard Worker '-I../pw_allocator/public', 464*61c4878aSAndroid Build Coastguard Worker '-I../pw_assert/public', 465*61c4878aSAndroid Build Coastguard Worker '-I../pw_assert/print_and_abort_assert_public_overrides', 466*61c4878aSAndroid Build Coastguard Worker '-I../pw_preprocessor/public', 467*61c4878aSAndroid Build Coastguard Worker '-I../pw_assert_basic/public_overrides', 468*61c4878aSAndroid Build Coastguard Worker '-I../pw_assert_basic/public', 469*61c4878aSAndroid Build Coastguard Worker '-I../pw_span/public', 470*61c4878aSAndroid Build Coastguard Worker '-I../pw_polyfill/public', 471*61c4878aSAndroid Build Coastguard Worker '-I../pw_polyfill/standard_library_public', 472*61c4878aSAndroid Build Coastguard Worker '-I../pw_status/public', 473*61c4878aSAndroid Build Coastguard Worker '-c', 474*61c4878aSAndroid Build Coastguard Worker '../pw_allocator/block.cc', 475*61c4878aSAndroid Build Coastguard Worker '-o', 476*61c4878aSAndroid Build Coastguard Worker 'isosceles_debug/obj/pw_allocator/block.block.cc.o', 477*61c4878aSAndroid Build Coastguard Worker ], 478*61c4878aSAndroid Build Coastguard Worker ), 479*61c4878aSAndroid Build Coastguard Worker ( 480*61c4878aSAndroid Build Coastguard Worker None, 481*61c4878aSAndroid Build Coastguard Worker '../environment/cipd/packages/pigweed/bin/clang++', 482*61c4878aSAndroid Build Coastguard Worker [ 483*61c4878aSAndroid Build Coastguard Worker '-MMD', 484*61c4878aSAndroid Build Coastguard Worker '-MF', 485*61c4878aSAndroid Build Coastguard Worker 'pw_strict_host_clang_debug/obj/pw_allocator/block.block.cc.o.d', 486*61c4878aSAndroid Build Coastguard Worker '-g3', 487*61c4878aSAndroid Build Coastguard Worker '--sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk', 488*61c4878aSAndroid Build Coastguard Worker '-Og', 489*61c4878aSAndroid Build Coastguard Worker '-Wshadow', 490*61c4878aSAndroid Build Coastguard Worker '-Wredundant-decls', 491*61c4878aSAndroid Build Coastguard Worker '-Wthread-safety', 492*61c4878aSAndroid Build Coastguard Worker '-Wswitch-enum', 493*61c4878aSAndroid Build Coastguard Worker '-fdiagnostics-color', 494*61c4878aSAndroid Build Coastguard Worker '-g', 495*61c4878aSAndroid Build Coastguard Worker '-fno-common', 496*61c4878aSAndroid Build Coastguard Worker '-fno-exceptions', 497*61c4878aSAndroid Build Coastguard Worker '-ffunction-sections', 498*61c4878aSAndroid Build Coastguard Worker '-fdata-sections', 499*61c4878aSAndroid Build Coastguard Worker '-Wall', 500*61c4878aSAndroid Build Coastguard Worker '-Wextra', 501*61c4878aSAndroid Build Coastguard Worker '-Wimplicit-fallthrough', 502*61c4878aSAndroid Build Coastguard Worker '-Wcast-qual', 503*61c4878aSAndroid Build Coastguard Worker '-Wundef', 504*61c4878aSAndroid Build Coastguard Worker '-Wpointer-arith', 505*61c4878aSAndroid Build Coastguard Worker '-Werror', 506*61c4878aSAndroid Build Coastguard Worker '-Wno-error=cpp', 507*61c4878aSAndroid Build Coastguard Worker '-Wno-error=deprecated-declarations', 508*61c4878aSAndroid Build Coastguard Worker '-ffile-prefix-map=/pigweed/pigweed/out=out', 509*61c4878aSAndroid Build Coastguard Worker '-ffile-prefix-map=/pigweed/pigweed/=', 510*61c4878aSAndroid Build Coastguard Worker '-ffile-prefix-map=../=', 511*61c4878aSAndroid Build Coastguard Worker '-ffile-prefix-map=/pigweed/pigweed/out=out', 512*61c4878aSAndroid Build Coastguard Worker '-Wextra-semi', 513*61c4878aSAndroid Build Coastguard Worker '-fno-rtti', 514*61c4878aSAndroid Build Coastguard Worker '-Wnon-virtual-dtor', 515*61c4878aSAndroid Build Coastguard Worker '-std=c++17', 516*61c4878aSAndroid Build Coastguard Worker '-Wno-register', 517*61c4878aSAndroid Build Coastguard Worker '-D_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS=1', 518*61c4878aSAndroid Build Coastguard Worker '-DPW_STATUS_CFG_CHECK_IF_USED=1', 519*61c4878aSAndroid Build Coastguard Worker '-I../pw_allocator/public', 520*61c4878aSAndroid Build Coastguard Worker '-I../pw_assert/public', 521*61c4878aSAndroid Build Coastguard Worker '-I../pw_assert/print_and_abort_assert_public_overrides', 522*61c4878aSAndroid Build Coastguard Worker '-I../pw_preprocessor/public', 523*61c4878aSAndroid Build Coastguard Worker '-I../pw_assert_basic/public_overrides', 524*61c4878aSAndroid Build Coastguard Worker '-I../pw_assert_basic/public', 525*61c4878aSAndroid Build Coastguard Worker '-I../pw_span/public', 526*61c4878aSAndroid Build Coastguard Worker '-I../pw_polyfill/public', 527*61c4878aSAndroid Build Coastguard Worker '-I../pw_polyfill/standard_library_public', 528*61c4878aSAndroid Build Coastguard Worker '-I../pw_status/public', 529*61c4878aSAndroid Build Coastguard Worker '-c', 530*61c4878aSAndroid Build Coastguard Worker '../pw_allocator/block.cc', 531*61c4878aSAndroid Build Coastguard Worker '-o', 532*61c4878aSAndroid Build Coastguard Worker 'pw_strict_host_clang_debug/obj/pw_allocator/block.block.cc.o', 533*61c4878aSAndroid Build Coastguard Worker ], 534*61c4878aSAndroid Build Coastguard Worker ), 535*61c4878aSAndroid Build Coastguard Worker ( 536*61c4878aSAndroid Build Coastguard Worker 'ccache', 537*61c4878aSAndroid Build Coastguard Worker 'arm-none-eabi-g++', 538*61c4878aSAndroid Build Coastguard Worker [ 539*61c4878aSAndroid Build Coastguard Worker '-MMD', 540*61c4878aSAndroid Build Coastguard Worker '-MF', 541*61c4878aSAndroid Build Coastguard Worker 'stm32f429i_disc1_debug/obj/pw_allocator/block.block.cc.o.d', 542*61c4878aSAndroid Build Coastguard Worker '-Wno-psabi', 543*61c4878aSAndroid Build Coastguard Worker '-mabi=aapcs', 544*61c4878aSAndroid Build Coastguard Worker '-mthumb', 545*61c4878aSAndroid Build Coastguard Worker '--sysroot=../environment/cipd/packages/arm', 546*61c4878aSAndroid Build Coastguard Worker '-specs=nano.specs', 547*61c4878aSAndroid Build Coastguard Worker '-specs=nosys.specs', 548*61c4878aSAndroid Build Coastguard Worker '-mcpu=cortex-m4', 549*61c4878aSAndroid Build Coastguard Worker '-mfloat-abi=hard', 550*61c4878aSAndroid Build Coastguard Worker '-mfpu=fpv4-sp-d16', 551*61c4878aSAndroid Build Coastguard Worker '-Og', 552*61c4878aSAndroid Build Coastguard Worker '-Wshadow', 553*61c4878aSAndroid Build Coastguard Worker '-Wredundant-decls', 554*61c4878aSAndroid Build Coastguard Worker '-u_printf_float', 555*61c4878aSAndroid Build Coastguard Worker '-fdiagnostics-color', 556*61c4878aSAndroid Build Coastguard Worker '-g', 557*61c4878aSAndroid Build Coastguard Worker '-fno-common', 558*61c4878aSAndroid Build Coastguard Worker '-fno-exceptions', 559*61c4878aSAndroid Build Coastguard Worker '-ffunction-sections', 560*61c4878aSAndroid Build Coastguard Worker '-fdata-sections', 561*61c4878aSAndroid Build Coastguard Worker '-Wall', 562*61c4878aSAndroid Build Coastguard Worker '-Wextra', 563*61c4878aSAndroid Build Coastguard Worker '-Wimplicit-fallthrough', 564*61c4878aSAndroid Build Coastguard Worker '-Wcast-qual', 565*61c4878aSAndroid Build Coastguard Worker '-Wundef', 566*61c4878aSAndroid Build Coastguard Worker '-Wpointer-arith', 567*61c4878aSAndroid Build Coastguard Worker '-Werror', 568*61c4878aSAndroid Build Coastguard Worker '-Wno-error=cpp', 569*61c4878aSAndroid Build Coastguard Worker '-Wno-error=deprecated-declarations', 570*61c4878aSAndroid Build Coastguard Worker '-ffile-prefix-map=/pigweed/pigweed/out=out', 571*61c4878aSAndroid Build Coastguard Worker '-ffile-prefix-map=/pigweed/pigweed/=', 572*61c4878aSAndroid Build Coastguard Worker '-ffile-prefix-map=../=', 573*61c4878aSAndroid Build Coastguard Worker '-ffile-prefix-map=/pigweed/pigweed/out=out', 574*61c4878aSAndroid Build Coastguard Worker '-fno-rtti', 575*61c4878aSAndroid Build Coastguard Worker '-Wnon-virtual-dtor', 576*61c4878aSAndroid Build Coastguard Worker '-std=c++17', 577*61c4878aSAndroid Build Coastguard Worker '-Wno-register', 578*61c4878aSAndroid Build Coastguard Worker '-DPW_ARMV7M_ENABLE_FPU=1', 579*61c4878aSAndroid Build Coastguard Worker '-I../pw_allocator/public', 580*61c4878aSAndroid Build Coastguard Worker '-I../pw_assert/public', 581*61c4878aSAndroid Build Coastguard Worker '-I../pw_assert/assert_compatibility_public_overrides', 582*61c4878aSAndroid Build Coastguard Worker '-I../pw_preprocessor/public', 583*61c4878aSAndroid Build Coastguard Worker '-I../pw_assert_basic/public_overrides', 584*61c4878aSAndroid Build Coastguard Worker '-I../pw_assert_basic/public', 585*61c4878aSAndroid Build Coastguard Worker '-I../pw_span/public', 586*61c4878aSAndroid Build Coastguard Worker '-I../pw_polyfill/public', 587*61c4878aSAndroid Build Coastguard Worker '-I../pw_polyfill/standard_library_public', 588*61c4878aSAndroid Build Coastguard Worker '-I../pw_status/public', 589*61c4878aSAndroid Build Coastguard Worker '-c', 590*61c4878aSAndroid Build Coastguard Worker '../pw_allocator/block.cc', 591*61c4878aSAndroid Build Coastguard Worker '-o', 592*61c4878aSAndroid Build Coastguard Worker 'stm32f429i_disc1_debug/obj/pw_allocator/block.block.cc.o', 593*61c4878aSAndroid Build Coastguard Worker ], 594*61c4878aSAndroid Build Coastguard Worker ), 595*61c4878aSAndroid Build Coastguard Worker ( 596*61c4878aSAndroid Build Coastguard Worker 'ccache', 597*61c4878aSAndroid Build Coastguard Worker '../environment/cipd/packages/pigweed/bin/isosceles-clang++', 598*61c4878aSAndroid Build Coastguard Worker [ 599*61c4878aSAndroid Build Coastguard Worker '-MMD', 600*61c4878aSAndroid Build Coastguard Worker '-MF', 601*61c4878aSAndroid Build Coastguard Worker 'isosceles_debug/obj/pw_allocator/block.block.cc.o.d', 602*61c4878aSAndroid Build Coastguard Worker '-g3', 603*61c4878aSAndroid Build Coastguard Worker '--sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk', 604*61c4878aSAndroid Build Coastguard Worker '-Og', 605*61c4878aSAndroid Build Coastguard Worker '-Wshadow', 606*61c4878aSAndroid Build Coastguard Worker '-Wredundant-decls', 607*61c4878aSAndroid Build Coastguard Worker '-Wthread-safety', 608*61c4878aSAndroid Build Coastguard Worker '-Wswitch-enum', 609*61c4878aSAndroid Build Coastguard Worker '-fdiagnostics-color', 610*61c4878aSAndroid Build Coastguard Worker '-g', 611*61c4878aSAndroid Build Coastguard Worker '-fno-common', 612*61c4878aSAndroid Build Coastguard Worker '-fno-exceptions', 613*61c4878aSAndroid Build Coastguard Worker '-ffunction-sections', 614*61c4878aSAndroid Build Coastguard Worker '-fdata-sections', 615*61c4878aSAndroid Build Coastguard Worker '-Wall', 616*61c4878aSAndroid Build Coastguard Worker '-Wextra', 617*61c4878aSAndroid Build Coastguard Worker '-Wimplicit-fallthrough', 618*61c4878aSAndroid Build Coastguard Worker '-Wcast-qual', 619*61c4878aSAndroid Build Coastguard Worker '-Wundef', 620*61c4878aSAndroid Build Coastguard Worker '-Wpointer-arith', 621*61c4878aSAndroid Build Coastguard Worker '-Werror', 622*61c4878aSAndroid Build Coastguard Worker '-Wno-error=cpp', 623*61c4878aSAndroid Build Coastguard Worker '-Wno-error=deprecated-declarations', 624*61c4878aSAndroid Build Coastguard Worker '-ffile-prefix-map=/pigweed/pigweed/out=out', 625*61c4878aSAndroid Build Coastguard Worker '-ffile-prefix-map=/pigweed/pigweed/=', 626*61c4878aSAndroid Build Coastguard Worker '-ffile-prefix-map=../=', 627*61c4878aSAndroid Build Coastguard Worker '-ffile-prefix-map=/pigweed/pigweed/out=out', 628*61c4878aSAndroid Build Coastguard Worker '-Wextra-semi', 629*61c4878aSAndroid Build Coastguard Worker '-fno-rtti', 630*61c4878aSAndroid Build Coastguard Worker '-Wnon-virtual-dtor', 631*61c4878aSAndroid Build Coastguard Worker '-std=c++17', 632*61c4878aSAndroid Build Coastguard Worker '-Wno-register', 633*61c4878aSAndroid Build Coastguard Worker '-D_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS=1', 634*61c4878aSAndroid Build Coastguard Worker '-DPW_STATUS_CFG_CHECK_IF_USED=1', 635*61c4878aSAndroid Build Coastguard Worker '-I../pw_allocator/public', 636*61c4878aSAndroid Build Coastguard Worker '-I../pw_assert/public', 637*61c4878aSAndroid Build Coastguard Worker '-I../pw_assert/print_and_abort_assert_public_overrides', 638*61c4878aSAndroid Build Coastguard Worker '-I../pw_preprocessor/public', 639*61c4878aSAndroid Build Coastguard Worker '-I../pw_assert_basic/public_overrides', 640*61c4878aSAndroid Build Coastguard Worker '-I../pw_assert_basic/public', 641*61c4878aSAndroid Build Coastguard Worker '-I../pw_span/public', 642*61c4878aSAndroid Build Coastguard Worker '-I../pw_polyfill/public', 643*61c4878aSAndroid Build Coastguard Worker '-I../pw_polyfill/standard_library_public', 644*61c4878aSAndroid Build Coastguard Worker '-I../pw_status/public', 645*61c4878aSAndroid Build Coastguard Worker '-c', 646*61c4878aSAndroid Build Coastguard Worker '../pw_allocator/block.cc', 647*61c4878aSAndroid Build Coastguard Worker '-o', 648*61c4878aSAndroid Build Coastguard Worker 'isosceles_debug/obj/pw_allocator/block.block.cc.o', 649*61c4878aSAndroid Build Coastguard Worker ], 650*61c4878aSAndroid Build Coastguard Worker ), 651*61c4878aSAndroid Build Coastguard Worker ( 652*61c4878aSAndroid Build Coastguard Worker 'ccache', 653*61c4878aSAndroid Build Coastguard Worker '../environment/cipd/packages/pigweed/bin/clang++', 654*61c4878aSAndroid Build Coastguard Worker [ 655*61c4878aSAndroid Build Coastguard Worker '-MMD', 656*61c4878aSAndroid Build Coastguard Worker '-MF', 657*61c4878aSAndroid Build Coastguard Worker 'pw_strict_host_clang_debug/obj/pw_allocator/block.block.cc.o.d', 658*61c4878aSAndroid Build Coastguard Worker '-g3', 659*61c4878aSAndroid Build Coastguard Worker '--sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk', 660*61c4878aSAndroid Build Coastguard Worker '-Og', 661*61c4878aSAndroid Build Coastguard Worker '-Wshadow', 662*61c4878aSAndroid Build Coastguard Worker '-Wredundant-decls', 663*61c4878aSAndroid Build Coastguard Worker '-Wthread-safety', 664*61c4878aSAndroid Build Coastguard Worker '-Wswitch-enum', 665*61c4878aSAndroid Build Coastguard Worker '-fdiagnostics-color', 666*61c4878aSAndroid Build Coastguard Worker '-g', 667*61c4878aSAndroid Build Coastguard Worker '-fno-common', 668*61c4878aSAndroid Build Coastguard Worker '-fno-exceptions', 669*61c4878aSAndroid Build Coastguard Worker '-ffunction-sections', 670*61c4878aSAndroid Build Coastguard Worker '-fdata-sections', 671*61c4878aSAndroid Build Coastguard Worker '-Wall', 672*61c4878aSAndroid Build Coastguard Worker '-Wextra', 673*61c4878aSAndroid Build Coastguard Worker '-Wimplicit-fallthrough', 674*61c4878aSAndroid Build Coastguard Worker '-Wcast-qual', 675*61c4878aSAndroid Build Coastguard Worker '-Wundef', 676*61c4878aSAndroid Build Coastguard Worker '-Wpointer-arith', 677*61c4878aSAndroid Build Coastguard Worker '-Werror', 678*61c4878aSAndroid Build Coastguard Worker '-Wno-error=cpp', 679*61c4878aSAndroid Build Coastguard Worker '-Wno-error=deprecated-declarations', 680*61c4878aSAndroid Build Coastguard Worker '-ffile-prefix-map=/pigweed/pigweed/out=out', 681*61c4878aSAndroid Build Coastguard Worker '-ffile-prefix-map=/pigweed/pigweed/=', 682*61c4878aSAndroid Build Coastguard Worker '-ffile-prefix-map=../=', 683*61c4878aSAndroid Build Coastguard Worker '-ffile-prefix-map=/pigweed/pigweed/out=out', 684*61c4878aSAndroid Build Coastguard Worker '-Wextra-semi', 685*61c4878aSAndroid Build Coastguard Worker '-fno-rtti', 686*61c4878aSAndroid Build Coastguard Worker '-Wnon-virtual-dtor', 687*61c4878aSAndroid Build Coastguard Worker '-std=c++17', 688*61c4878aSAndroid Build Coastguard Worker '-Wno-register', 689*61c4878aSAndroid Build Coastguard Worker '-D_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS=1', 690*61c4878aSAndroid Build Coastguard Worker '-DPW_STATUS_CFG_CHECK_IF_USED=1', 691*61c4878aSAndroid Build Coastguard Worker '-I../pw_allocator/public', 692*61c4878aSAndroid Build Coastguard Worker '-I../pw_assert/public', 693*61c4878aSAndroid Build Coastguard Worker '-I../pw_assert/print_and_abort_assert_public_overrides', 694*61c4878aSAndroid Build Coastguard Worker '-I../pw_preprocessor/public', 695*61c4878aSAndroid Build Coastguard Worker '-I../pw_assert_basic/public_overrides', 696*61c4878aSAndroid Build Coastguard Worker '-I../pw_assert_basic/public', 697*61c4878aSAndroid Build Coastguard Worker '-I../pw_span/public', 698*61c4878aSAndroid Build Coastguard Worker '-I../pw_polyfill/public', 699*61c4878aSAndroid Build Coastguard Worker '-I../pw_polyfill/standard_library_public', 700*61c4878aSAndroid Build Coastguard Worker '-I../pw_status/public', 701*61c4878aSAndroid Build Coastguard Worker '-c', 702*61c4878aSAndroid Build Coastguard Worker '../pw_allocator/block.cc', 703*61c4878aSAndroid Build Coastguard Worker '-o', 704*61c4878aSAndroid Build Coastguard Worker 'pw_strict_host_clang_debug/obj/pw_allocator/block.block.cc.o', 705*61c4878aSAndroid Build Coastguard Worker ], 706*61c4878aSAndroid Build Coastguard Worker ), 707*61c4878aSAndroid Build Coastguard Worker ( 708*61c4878aSAndroid Build Coastguard Worker 'ccache debug=true max_size=10G', 709*61c4878aSAndroid Build Coastguard Worker 'arm-none-eabi-g++', 710*61c4878aSAndroid Build Coastguard Worker [ 711*61c4878aSAndroid Build Coastguard Worker '-MMD', 712*61c4878aSAndroid Build Coastguard Worker '-MF', 713*61c4878aSAndroid Build Coastguard Worker 'stm32f429i_disc1_debug/obj/pw_allocator/block.block.cc.o.d', 714*61c4878aSAndroid Build Coastguard Worker '-Wno-psabi', 715*61c4878aSAndroid Build Coastguard Worker '-mabi=aapcs', 716*61c4878aSAndroid Build Coastguard Worker '-mthumb', 717*61c4878aSAndroid Build Coastguard Worker '--sysroot=../environment/cipd/packages/arm', 718*61c4878aSAndroid Build Coastguard Worker '-specs=nano.specs', 719*61c4878aSAndroid Build Coastguard Worker '-specs=nosys.specs', 720*61c4878aSAndroid Build Coastguard Worker '-mcpu=cortex-m4', 721*61c4878aSAndroid Build Coastguard Worker '-mfloat-abi=hard', 722*61c4878aSAndroid Build Coastguard Worker '-mfpu=fpv4-sp-d16', 723*61c4878aSAndroid Build Coastguard Worker '-Og', 724*61c4878aSAndroid Build Coastguard Worker '-Wshadow', 725*61c4878aSAndroid Build Coastguard Worker '-Wredundant-decls', 726*61c4878aSAndroid Build Coastguard Worker '-u_printf_float', 727*61c4878aSAndroid Build Coastguard Worker '-fdiagnostics-color', 728*61c4878aSAndroid Build Coastguard Worker '-g', 729*61c4878aSAndroid Build Coastguard Worker '-fno-common', 730*61c4878aSAndroid Build Coastguard Worker '-fno-exceptions', 731*61c4878aSAndroid Build Coastguard Worker '-ffunction-sections', 732*61c4878aSAndroid Build Coastguard Worker '-fdata-sections', 733*61c4878aSAndroid Build Coastguard Worker '-Wall', 734*61c4878aSAndroid Build Coastguard Worker '-Wextra', 735*61c4878aSAndroid Build Coastguard Worker '-Wimplicit-fallthrough', 736*61c4878aSAndroid Build Coastguard Worker '-Wcast-qual', 737*61c4878aSAndroid Build Coastguard Worker '-Wundef', 738*61c4878aSAndroid Build Coastguard Worker '-Wpointer-arith', 739*61c4878aSAndroid Build Coastguard Worker '-Werror', 740*61c4878aSAndroid Build Coastguard Worker '-Wno-error=cpp', 741*61c4878aSAndroid Build Coastguard Worker '-Wno-error=deprecated-declarations', 742*61c4878aSAndroid Build Coastguard Worker '-ffile-prefix-map=/pigweed/pigweed/out=out', 743*61c4878aSAndroid Build Coastguard Worker '-ffile-prefix-map=/pigweed/pigweed/=', 744*61c4878aSAndroid Build Coastguard Worker '-ffile-prefix-map=../=', 745*61c4878aSAndroid Build Coastguard Worker '-ffile-prefix-map=/pigweed/pigweed/out=out', 746*61c4878aSAndroid Build Coastguard Worker '-fno-rtti', 747*61c4878aSAndroid Build Coastguard Worker '-Wnon-virtual-dtor', 748*61c4878aSAndroid Build Coastguard Worker '-std=c++17', 749*61c4878aSAndroid Build Coastguard Worker '-Wno-register', 750*61c4878aSAndroid Build Coastguard Worker '-DPW_ARMV7M_ENABLE_FPU=1', 751*61c4878aSAndroid Build Coastguard Worker '-I../pw_allocator/public', 752*61c4878aSAndroid Build Coastguard Worker '-I../pw_assert/public', 753*61c4878aSAndroid Build Coastguard Worker '-I../pw_assert/assert_compatibility_public_overrides', 754*61c4878aSAndroid Build Coastguard Worker '-I../pw_preprocessor/public', 755*61c4878aSAndroid Build Coastguard Worker '-I../pw_assert_basic/public_overrides', 756*61c4878aSAndroid Build Coastguard Worker '-I../pw_assert_basic/public', 757*61c4878aSAndroid Build Coastguard Worker '-I../pw_span/public', 758*61c4878aSAndroid Build Coastguard Worker '-I../pw_polyfill/public', 759*61c4878aSAndroid Build Coastguard Worker '-I../pw_polyfill/standard_library_public', 760*61c4878aSAndroid Build Coastguard Worker '-I../pw_status/public', 761*61c4878aSAndroid Build Coastguard Worker '-c', 762*61c4878aSAndroid Build Coastguard Worker '../pw_allocator/block.cc', 763*61c4878aSAndroid Build Coastguard Worker '-o', 764*61c4878aSAndroid Build Coastguard Worker 'stm32f429i_disc1_debug/obj/pw_allocator/block.block.cc.o', 765*61c4878aSAndroid Build Coastguard Worker ], 766*61c4878aSAndroid Build Coastguard Worker ), 767*61c4878aSAndroid Build Coastguard Worker ( 768*61c4878aSAndroid Build Coastguard Worker 'ccache debug=true max_size=10G', 769*61c4878aSAndroid Build Coastguard Worker '../environment/cipd/packages/pigweed/bin/isosceles-clang++', 770*61c4878aSAndroid Build Coastguard Worker [ 771*61c4878aSAndroid Build Coastguard Worker '-MMD', 772*61c4878aSAndroid Build Coastguard Worker '-MF', 773*61c4878aSAndroid Build Coastguard Worker 'isosceles_debug/obj/pw_allocator/block.block.cc.o.d', 774*61c4878aSAndroid Build Coastguard Worker '-g3', 775*61c4878aSAndroid Build Coastguard Worker '--sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk', 776*61c4878aSAndroid Build Coastguard Worker '-Og', 777*61c4878aSAndroid Build Coastguard Worker '-Wshadow', 778*61c4878aSAndroid Build Coastguard Worker '-Wredundant-decls', 779*61c4878aSAndroid Build Coastguard Worker '-Wthread-safety', 780*61c4878aSAndroid Build Coastguard Worker '-Wswitch-enum', 781*61c4878aSAndroid Build Coastguard Worker '-fdiagnostics-color', 782*61c4878aSAndroid Build Coastguard Worker '-g', 783*61c4878aSAndroid Build Coastguard Worker '-fno-common', 784*61c4878aSAndroid Build Coastguard Worker '-fno-exceptions', 785*61c4878aSAndroid Build Coastguard Worker '-ffunction-sections', 786*61c4878aSAndroid Build Coastguard Worker '-fdata-sections', 787*61c4878aSAndroid Build Coastguard Worker '-Wall', 788*61c4878aSAndroid Build Coastguard Worker '-Wextra', 789*61c4878aSAndroid Build Coastguard Worker '-Wimplicit-fallthrough', 790*61c4878aSAndroid Build Coastguard Worker '-Wcast-qual', 791*61c4878aSAndroid Build Coastguard Worker '-Wundef', 792*61c4878aSAndroid Build Coastguard Worker '-Wpointer-arith', 793*61c4878aSAndroid Build Coastguard Worker '-Werror', 794*61c4878aSAndroid Build Coastguard Worker '-Wno-error=cpp', 795*61c4878aSAndroid Build Coastguard Worker '-Wno-error=deprecated-declarations', 796*61c4878aSAndroid Build Coastguard Worker '-ffile-prefix-map=/pigweed/pigweed/out=out', 797*61c4878aSAndroid Build Coastguard Worker '-ffile-prefix-map=/pigweed/pigweed/=', 798*61c4878aSAndroid Build Coastguard Worker '-ffile-prefix-map=../=', 799*61c4878aSAndroid Build Coastguard Worker '-ffile-prefix-map=/pigweed/pigweed/out=out', 800*61c4878aSAndroid Build Coastguard Worker '-Wextra-semi', 801*61c4878aSAndroid Build Coastguard Worker '-fno-rtti', 802*61c4878aSAndroid Build Coastguard Worker '-Wnon-virtual-dtor', 803*61c4878aSAndroid Build Coastguard Worker '-std=c++17', 804*61c4878aSAndroid Build Coastguard Worker '-Wno-register', 805*61c4878aSAndroid Build Coastguard Worker '-D_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS=1', 806*61c4878aSAndroid Build Coastguard Worker '-DPW_STATUS_CFG_CHECK_IF_USED=1', 807*61c4878aSAndroid Build Coastguard Worker '-I../pw_allocator/public', 808*61c4878aSAndroid Build Coastguard Worker '-I../pw_assert/public', 809*61c4878aSAndroid Build Coastguard Worker '-I../pw_assert/print_and_abort_assert_public_overrides', 810*61c4878aSAndroid Build Coastguard Worker '-I../pw_preprocessor/public', 811*61c4878aSAndroid Build Coastguard Worker '-I../pw_assert_basic/public_overrides', 812*61c4878aSAndroid Build Coastguard Worker '-I../pw_assert_basic/public', 813*61c4878aSAndroid Build Coastguard Worker '-I../pw_span/public', 814*61c4878aSAndroid Build Coastguard Worker '-I../pw_polyfill/public', 815*61c4878aSAndroid Build Coastguard Worker '-I../pw_polyfill/standard_library_public', 816*61c4878aSAndroid Build Coastguard Worker '-I../pw_status/public', 817*61c4878aSAndroid Build Coastguard Worker '-c', 818*61c4878aSAndroid Build Coastguard Worker '../pw_allocator/block.cc', 819*61c4878aSAndroid Build Coastguard Worker '-o', 820*61c4878aSAndroid Build Coastguard Worker 'isosceles_debug/obj/pw_allocator/block.block.cc.o', 821*61c4878aSAndroid Build Coastguard Worker ], 822*61c4878aSAndroid Build Coastguard Worker ), 823*61c4878aSAndroid Build Coastguard Worker ( 824*61c4878aSAndroid Build Coastguard Worker 'ccache debug=true max_size=10G', 825*61c4878aSAndroid Build Coastguard Worker '../environment/cipd/packages/pigweed/bin/clang++', 826*61c4878aSAndroid Build Coastguard Worker [ 827*61c4878aSAndroid Build Coastguard Worker '-MMD', 828*61c4878aSAndroid Build Coastguard Worker '-MF', 829*61c4878aSAndroid Build Coastguard Worker 'pw_strict_host_clang_debug/obj/pw_allocator/block.block.cc.o.d', 830*61c4878aSAndroid Build Coastguard Worker '-g3', 831*61c4878aSAndroid Build Coastguard Worker '--sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk', 832*61c4878aSAndroid Build Coastguard Worker '-Og', 833*61c4878aSAndroid Build Coastguard Worker '-Wshadow', 834*61c4878aSAndroid Build Coastguard Worker '-Wredundant-decls', 835*61c4878aSAndroid Build Coastguard Worker '-Wthread-safety', 836*61c4878aSAndroid Build Coastguard Worker '-Wswitch-enum', 837*61c4878aSAndroid Build Coastguard Worker '-fdiagnostics-color', 838*61c4878aSAndroid Build Coastguard Worker '-g', 839*61c4878aSAndroid Build Coastguard Worker '-fno-common', 840*61c4878aSAndroid Build Coastguard Worker '-fno-exceptions', 841*61c4878aSAndroid Build Coastguard Worker '-ffunction-sections', 842*61c4878aSAndroid Build Coastguard Worker '-fdata-sections', 843*61c4878aSAndroid Build Coastguard Worker '-Wall', 844*61c4878aSAndroid Build Coastguard Worker '-Wextra', 845*61c4878aSAndroid Build Coastguard Worker '-Wimplicit-fallthrough', 846*61c4878aSAndroid Build Coastguard Worker '-Wcast-qual', 847*61c4878aSAndroid Build Coastguard Worker '-Wundef', 848*61c4878aSAndroid Build Coastguard Worker '-Wpointer-arith', 849*61c4878aSAndroid Build Coastguard Worker '-Werror', 850*61c4878aSAndroid Build Coastguard Worker '-Wno-error=cpp', 851*61c4878aSAndroid Build Coastguard Worker '-Wno-error=deprecated-declarations', 852*61c4878aSAndroid Build Coastguard Worker '-ffile-prefix-map=/pigweed/pigweed/out=out', 853*61c4878aSAndroid Build Coastguard Worker '-ffile-prefix-map=/pigweed/pigweed/=', 854*61c4878aSAndroid Build Coastguard Worker '-ffile-prefix-map=../=', 855*61c4878aSAndroid Build Coastguard Worker '-ffile-prefix-map=/pigweed/pigweed/out=out', 856*61c4878aSAndroid Build Coastguard Worker '-Wextra-semi', 857*61c4878aSAndroid Build Coastguard Worker '-fno-rtti', 858*61c4878aSAndroid Build Coastguard Worker '-Wnon-virtual-dtor', 859*61c4878aSAndroid Build Coastguard Worker '-std=c++17', 860*61c4878aSAndroid Build Coastguard Worker '-Wno-register', 861*61c4878aSAndroid Build Coastguard Worker '-D_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS=1', 862*61c4878aSAndroid Build Coastguard Worker '-DPW_STATUS_CFG_CHECK_IF_USED=1', 863*61c4878aSAndroid Build Coastguard Worker '-I../pw_allocator/public', 864*61c4878aSAndroid Build Coastguard Worker '-I../pw_assert/public', 865*61c4878aSAndroid Build Coastguard Worker '-I../pw_assert/print_and_abort_assert_public_overrides', 866*61c4878aSAndroid Build Coastguard Worker '-I../pw_preprocessor/public', 867*61c4878aSAndroid Build Coastguard Worker '-I../pw_assert_basic/public_overrides', 868*61c4878aSAndroid Build Coastguard Worker '-I../pw_assert_basic/public', 869*61c4878aSAndroid Build Coastguard Worker '-I../pw_span/public', 870*61c4878aSAndroid Build Coastguard Worker '-I../pw_polyfill/public', 871*61c4878aSAndroid Build Coastguard Worker '-I../pw_polyfill/standard_library_public', 872*61c4878aSAndroid Build Coastguard Worker '-I../pw_status/public', 873*61c4878aSAndroid Build Coastguard Worker '-c', 874*61c4878aSAndroid Build Coastguard Worker '../pw_allocator/block.cc', 875*61c4878aSAndroid Build Coastguard Worker '-o', 876*61c4878aSAndroid Build Coastguard Worker 'pw_strict_host_clang_debug/obj/pw_allocator/block.block.cc.o', 877*61c4878aSAndroid Build Coastguard Worker ], 878*61c4878aSAndroid Build Coastguard Worker ), 879*61c4878aSAndroid Build Coastguard Worker ( 880*61c4878aSAndroid Build Coastguard Worker 'ccache', 881*61c4878aSAndroid Build Coastguard Worker 'python', 882*61c4878aSAndroid Build Coastguard Worker [ 883*61c4878aSAndroid Build Coastguard Worker '../pw_toolchain/py/pw_toolchain/clang_tidy.py', 884*61c4878aSAndroid Build Coastguard Worker '--source-exclude', 885*61c4878aSAndroid Build Coastguard Worker "'third_party/.*'", 886*61c4878aSAndroid Build Coastguard Worker '--source-exclude', 887*61c4878aSAndroid Build Coastguard Worker "'.*packages/mbedtls.*'", 888*61c4878aSAndroid Build Coastguard Worker '--source-exclude', 889*61c4878aSAndroid Build Coastguard Worker "'.*packages/boringssl.*'", 890*61c4878aSAndroid Build Coastguard Worker '--skip-include-path', 891*61c4878aSAndroid Build Coastguard Worker "'mbedtls/include'", 892*61c4878aSAndroid Build Coastguard Worker '--skip-include-path', 893*61c4878aSAndroid Build Coastguard Worker "'mbedtls'", 894*61c4878aSAndroid Build Coastguard Worker '--skip-include-path', 895*61c4878aSAndroid Build Coastguard Worker "'boringssl/src/include'", 896*61c4878aSAndroid Build Coastguard Worker '--skip-include-path', 897*61c4878aSAndroid Build Coastguard Worker "'boringssl'", 898*61c4878aSAndroid Build Coastguard Worker '--skip-include-path', 899*61c4878aSAndroid Build Coastguard Worker "'pw_tls_client/generate_test_data'", 900*61c4878aSAndroid Build Coastguard Worker '--source-file', 901*61c4878aSAndroid Build Coastguard Worker '../pw_allocator/block.cc', 902*61c4878aSAndroid Build Coastguard Worker '--source-root', 903*61c4878aSAndroid Build Coastguard Worker "'../'", 904*61c4878aSAndroid Build Coastguard Worker '--export-fixes', 905*61c4878aSAndroid Build Coastguard Worker 'pw_strict_host_clang_debug.static_analysis/obj/pw_allocator/block.block.cc.o.yaml', 906*61c4878aSAndroid Build Coastguard Worker '--', 907*61c4878aSAndroid Build Coastguard Worker '../environment/cipd/packages/pigweed/bin/clang++', 908*61c4878aSAndroid Build Coastguard Worker 'END_OF_INVOKER', 909*61c4878aSAndroid Build Coastguard Worker '-MMD', 910*61c4878aSAndroid Build Coastguard Worker '-MF', 911*61c4878aSAndroid Build Coastguard Worker 'pw_strict_host_clang_debug.static_analysis/obj/pw_allocator/block.block.cc.o.d', 912*61c4878aSAndroid Build Coastguard Worker '-g3', 913*61c4878aSAndroid Build Coastguard Worker '--sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk', 914*61c4878aSAndroid Build Coastguard Worker '-Og', 915*61c4878aSAndroid Build Coastguard Worker '-Wshadow', 916*61c4878aSAndroid Build Coastguard Worker '-Wredundant-decls', 917*61c4878aSAndroid Build Coastguard Worker '-Wthread-safety', 918*61c4878aSAndroid Build Coastguard Worker '-Wswitch-enum', 919*61c4878aSAndroid Build Coastguard Worker '-fdiagnostics-color', 920*61c4878aSAndroid Build Coastguard Worker '-g', 921*61c4878aSAndroid Build Coastguard Worker '-fno-common', 922*61c4878aSAndroid Build Coastguard Worker '-fno-exceptions', 923*61c4878aSAndroid Build Coastguard Worker '-ffunction-sections', 924*61c4878aSAndroid Build Coastguard Worker '-fdata-sections', 925*61c4878aSAndroid Build Coastguard Worker '-Wall', 926*61c4878aSAndroid Build Coastguard Worker '-Wextra', 927*61c4878aSAndroid Build Coastguard Worker '-Wimplicit-fallthrough', 928*61c4878aSAndroid Build Coastguard Worker '-Wcast-qual', 929*61c4878aSAndroid Build Coastguard Worker '-Wundef', 930*61c4878aSAndroid Build Coastguard Worker '-Wpointer-arith', 931*61c4878aSAndroid Build Coastguard Worker '-Werror', 932*61c4878aSAndroid Build Coastguard Worker '-Wno-error=cpp', 933*61c4878aSAndroid Build Coastguard Worker '-Wno-error=deprecated-declarations', 934*61c4878aSAndroid Build Coastguard Worker '-ffile-prefix-map=/pigweed/pigweed/out=out', 935*61c4878aSAndroid Build Coastguard Worker '-ffile-prefix-map=/pigweed/pigweed/=', 936*61c4878aSAndroid Build Coastguard Worker '-ffile-prefix-map=../=', 937*61c4878aSAndroid Build Coastguard Worker '-ffile-prefix-map=/pigweed/pigweed/out=out', 938*61c4878aSAndroid Build Coastguard Worker '-Wextra-semi', 939*61c4878aSAndroid Build Coastguard Worker '-fno-rtti', 940*61c4878aSAndroid Build Coastguard Worker '-Wnon-virtual-dtor', 941*61c4878aSAndroid Build Coastguard Worker '-std=c++17', 942*61c4878aSAndroid Build Coastguard Worker '-Wno-register', 943*61c4878aSAndroid Build Coastguard Worker '-D_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS=1', 944*61c4878aSAndroid Build Coastguard Worker '-DPW_STATUS_CFG_CHECK_IF_USED=1', 945*61c4878aSAndroid Build Coastguard Worker '-I../pw_allocator/public', 946*61c4878aSAndroid Build Coastguard Worker '-I../pw_assert/public', 947*61c4878aSAndroid Build Coastguard Worker '-I../pw_assert/print_and_abort_assert_public_overrides', 948*61c4878aSAndroid Build Coastguard Worker '-I../pw_preprocessor/public', 949*61c4878aSAndroid Build Coastguard Worker '-I../pw_assert_basic/public_overrides', 950*61c4878aSAndroid Build Coastguard Worker '-I../pw_assert_basic/public', 951*61c4878aSAndroid Build Coastguard Worker '-I../pw_span/public', 952*61c4878aSAndroid Build Coastguard Worker '-I../pw_polyfill/public', 953*61c4878aSAndroid Build Coastguard Worker '-I../pw_polyfill/standard_library_public', 954*61c4878aSAndroid Build Coastguard Worker '-I../pw_status/public', 955*61c4878aSAndroid Build Coastguard Worker '-c', 956*61c4878aSAndroid Build Coastguard Worker '../pw_allocator/block.cc', 957*61c4878aSAndroid Build Coastguard Worker '-o', 958*61c4878aSAndroid Build Coastguard Worker 'pw_strict_host_clang_debug.static_analysis/obj/pw_allocator/block.block.cc.o', 959*61c4878aSAndroid Build Coastguard Worker '&&', 960*61c4878aSAndroid Build Coastguard Worker 'touch', 961*61c4878aSAndroid Build Coastguard Worker 'pw_strict_host_clang_debug.static_analysis/obj/pw_allocator/block.block.cc.o', 962*61c4878aSAndroid Build Coastguard Worker ], 963*61c4878aSAndroid Build Coastguard Worker ), 964*61c4878aSAndroid Build Coastguard Worker ] 965*61c4878aSAndroid Build Coastguard Worker # pylint: enable=line-too-long 966*61c4878aSAndroid Build Coastguard Worker 967*61c4878aSAndroid Build Coastguard Worker for test_case, expected in zip(test_cases, expected_results): 968*61c4878aSAndroid Build Coastguard Worker self.assertEqual(command_parts(test_case), expected) 969*61c4878aSAndroid Build Coastguard Worker 970*61c4878aSAndroid Build Coastguard Worker 971*61c4878aSAndroid Build Coastguard Workerclass TestCppCompilationDatabase(PwIdeTestCase): 972*61c4878aSAndroid Build Coastguard Worker """Tests CppCompilationDatabase""" 973*61c4878aSAndroid Build Coastguard Worker 974*61c4878aSAndroid Build Coastguard Worker def setUp(self): 975*61c4878aSAndroid Build Coastguard Worker self.root_dir = Path('/pigweed/pigweed/out') 976*61c4878aSAndroid Build Coastguard Worker 977*61c4878aSAndroid Build Coastguard Worker self.fixture: list[CppCompileCommandDict] = [ 978*61c4878aSAndroid Build Coastguard Worker { 979*61c4878aSAndroid Build Coastguard Worker # pylint: disable=line-too-long 980*61c4878aSAndroid Build Coastguard Worker 'command': 'arm-none-eabi-g++ -MMD -MF stm32f429i_disc1_debug/obj/pw_allocator/block.block.cc.o.d -Wno-psabi -mabi=aapcs -mthumb --sysroot=../environment/cipd/packages/arm -specs=nano.specs -specs=nosys.specs -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Og -Wshadow -Wredundant-decls -u_printf_float -fdiagnostics-color -g -fno-common -fno-exceptions -ffunction-sections -fdata-sections -Wall -Wextra -Wimplicit-fallthrough -Wcast-qual -Wundef -Wpointer-arith -Werror -Wno-error=cpp -Wno-error=deprecated-declarations -ffile-prefix-map=/pigweed/pigweed/out=out -ffile-prefix-map=/pigweed/pigweed/= -ffile-prefix-map=../= -ffile-prefix-map=/pigweed/pigweed/out=out -fno-rtti -Wnon-virtual-dtor -std=c++17 -Wno-register -DPW_ARMV7M_ENABLE_FPU=1 -I../pw_allocator/public -I../pw_assert/public -I../pw_assert/assert_compatibility_public_overrides -I../pw_preprocessor/public -I../pw_assert_basic/public_overrides -I../pw_assert_basic/public -I../pw_span/public -I../pw_polyfill/public -I../pw_polyfill/standard_library_public -I../pw_status/public -c ../pw_allocator/block.cc -o stm32f429i_disc1_debug/obj/pw_allocator/block.block.cc.o', 981*61c4878aSAndroid Build Coastguard Worker # pylint: enable=line-too-long 982*61c4878aSAndroid Build Coastguard Worker 'directory': '/pigweed/pigweed/out', 983*61c4878aSAndroid Build Coastguard Worker 'file': '../pw_allocator/block.cc', 984*61c4878aSAndroid Build Coastguard Worker }, 985*61c4878aSAndroid Build Coastguard Worker { 986*61c4878aSAndroid Build Coastguard Worker # pylint: disable=line-too-long 987*61c4878aSAndroid Build Coastguard Worker 'command': '../environment/cipd/packages/pigweed/bin/clang++ -MMD -MF pw_strict_host_clang_debug/obj/pw_allocator/block.block.cc.o.d -g3 --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -Og -Wshadow -Wredundant-decls -Wthread-safety -Wswitch-enum -fdiagnostics-color -g -fno-common -fno-exceptions -ffunction-sections -fdata-sections -Wall -Wextra -Wimplicit-fallthrough -Wcast-qual -Wundef -Wpointer-arith -Werror -Wno-error=cpp -Wno-error=deprecated-declarations -ffile-prefix-map=/pigweed/pigweed/out=out -ffile-prefix-map=/pigweed/pigweed/= -ffile-prefix-map=../= -ffile-prefix-map=/pigweed/pigweed/out=out -Wextra-semi -fno-rtti -Wnon-virtual-dtor -std=c++17 -Wno-register -D_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS=1 -DPW_STATUS_CFG_CHECK_IF_USED=1 -I../pw_allocator/public -I../pw_assert/public -I../pw_assert/print_and_abort_assert_public_overrides -I../pw_preprocessor/public -I../pw_assert_basic/public_overrides -I../pw_assert_basic/public -I../pw_span/public -I../pw_polyfill/public -I../pw_polyfill/standard_library_public -I../pw_status/public -c ../pw_allocator/block.cc -o pw_strict_host_clang_debug/obj/pw_allocator/block.block.cc.o', 988*61c4878aSAndroid Build Coastguard Worker # pylint: enable=line-too-long 989*61c4878aSAndroid Build Coastguard Worker 'directory': '/pigweed/pigweed/out', 990*61c4878aSAndroid Build Coastguard Worker 'file': '../pw_allocator/block.cc', 991*61c4878aSAndroid Build Coastguard Worker }, 992*61c4878aSAndroid Build Coastguard Worker ] 993*61c4878aSAndroid Build Coastguard Worker 994*61c4878aSAndroid Build Coastguard Worker self.expected: list[CppCompileCommandDict] = [ 995*61c4878aSAndroid Build Coastguard Worker { 996*61c4878aSAndroid Build Coastguard Worker **self.fixture[0], 997*61c4878aSAndroid Build Coastguard Worker # pylint: disable=line-too-long 998*61c4878aSAndroid Build Coastguard Worker 'output': 'stm32f429i_disc1_debug/obj/pw_allocator/block.block.cc.o', 999*61c4878aSAndroid Build Coastguard Worker # pylint: enable=line-too-long 1000*61c4878aSAndroid Build Coastguard Worker }, 1001*61c4878aSAndroid Build Coastguard Worker { 1002*61c4878aSAndroid Build Coastguard Worker **self.fixture[1], 1003*61c4878aSAndroid Build Coastguard Worker # pylint: disable=line-too-long 1004*61c4878aSAndroid Build Coastguard Worker 'output': 'pw_strict_host_clang_debug/obj/pw_allocator/block.block.cc.o', 1005*61c4878aSAndroid Build Coastguard Worker # pylint: enable=line-too-long 1006*61c4878aSAndroid Build Coastguard Worker }, 1007*61c4878aSAndroid Build Coastguard Worker ] 1008*61c4878aSAndroid Build Coastguard Worker 1009*61c4878aSAndroid Build Coastguard Worker self.fixture_merge_1 = [ 1010*61c4878aSAndroid Build Coastguard Worker { 1011*61c4878aSAndroid Build Coastguard Worker # pylint: disable=line-too-long 1012*61c4878aSAndroid Build Coastguard Worker 'command': 'g++ -MMD -MF pw_strict_host_gcc_debug/obj/pw_allocator/block.block.cc.o.d -Wno-psabi -Og -Wshadow -Wredundant-decls -Wswitch-enum -Wpedantic -Wno-c++20-designator -Wno-gnu-zero-variadic-macro-arguments -fdiagnostics-color -g -fno-common -fno-exceptions -ffunction-sections -fdata-sections -Wall -Wextra -Wimplicit-fallthrough -Wcast-qual -Wundef -Wpointer-arith -Werror -Wno-error=cpp -Wno-error=deprecated-declarations -ffile-prefix-map=/pigweed/pigweed/out=out -ffile-prefix-map=/pigweed/pigweed/= -ffile-prefix-map=../= -ffile-prefix-map=/pigweed/pigweed/out=out -Wextra-semi -fno-rtti -Wnon-virtual-dtor -std=c++17 -Wno-register -DPW_SPAN_ENABLE_ASSERTS=true -DPW_STATUS_CFG_CHECK_IF_USED=1 -I../pw_allocator/public -I../pw_assert/public -I../pw_assert/print_and_abort_assert_public_overrides -I../pw_preprocessor/public -I../pw_assert_basic/public_overrides -I../pw_assert_basic/public -I../pw_span/public -I../pw_polyfill/public -I../pw_polyfill/standard_library_public -I../pw_status/public -c ../pw_allocator/block.cc -o pw_strict_host_gcc_debug/obj/pw_allocator/block.block.cc.o', 1013*61c4878aSAndroid Build Coastguard Worker 'directory': '/pigweed/pigweed/out', 1014*61c4878aSAndroid Build Coastguard Worker 'file': '../pw_allocator/block.cc', 1015*61c4878aSAndroid Build Coastguard Worker 'output': 'pw_strict_host_gcc_debug/obj/pw_allocator/block.block.cc.o', 1016*61c4878aSAndroid Build Coastguard Worker # pylint: enable=line-too-long 1017*61c4878aSAndroid Build Coastguard Worker }, 1018*61c4878aSAndroid Build Coastguard Worker { 1019*61c4878aSAndroid Build Coastguard Worker # pylint: disable=line-too-long 1020*61c4878aSAndroid Build Coastguard Worker 'command': 'g++ -MMD -MF pw_strict_host_gcc_debug/obj/pw_allocator/freelist.freelist.cc.o.d -Wno-psabi -Og -Wshadow -Wredundant-decls -Wswitch-enum -Wpedantic -Wno-c++20-designator -Wno-gnu-zero-variadic-macro-arguments -fdiagnostics-color -g -fno-common -fno-exceptions -ffunction-sections -fdata-sections -Wall -Wextra -Wimplicit-fallthrough -Wcast-qual -Wundef -Wpointer-arith -Werror -Wno-error=cpp -Wno-error=deprecated-declarations -ffile-prefix-map=//pigweed/pigweed/out=out -ffile-prefix-map=/pigweed/pigweed/= -ffile-prefix-map=../= -ffile-prefix-map=/pigweed/pigweed/out=out -Wextra-semi -fno-rtti -Wnon-virtual-dtor -std=c++17 -Wno-register -DPW_SPAN_ENABLE_ASSERTS=true -DPW_STATUS_CFG_CHECK_IF_USED=1 -I../pw_allocator/public -I../pw_containers/public -I../pw_assert/public -I../pw_assert/print_and_abort_assert_public_overrides -I../pw_preprocessor/public -I../pw_assert_basic/public_overrides -I../pw_assert_basic/public -I../pw_polyfill/public -I../pw_polyfill/standard_library_public -I../pw_span/public -I../pw_status/public -c ../pw_allocator/freelist.cc -o pw_strict_host_gcc_debug/obj/pw_allocator/freelist.freelist.cc.o', 1021*61c4878aSAndroid Build Coastguard Worker 'directory': '/pigweed/pigweed/out', 1022*61c4878aSAndroid Build Coastguard Worker 'file': '../pw_allocator/freelist.cc', 1023*61c4878aSAndroid Build Coastguard Worker 'output': 'pw_strict_host_gcc_debug/obj/pw_allocator/freelist.freelist.cc.o', 1024*61c4878aSAndroid Build Coastguard Worker # pylint: enable=line-too-long 1025*61c4878aSAndroid Build Coastguard Worker }, 1026*61c4878aSAndroid Build Coastguard Worker ] 1027*61c4878aSAndroid Build Coastguard Worker 1028*61c4878aSAndroid Build Coastguard Worker self.fixture_merge_2 = [ 1029*61c4878aSAndroid Build Coastguard Worker { 1030*61c4878aSAndroid Build Coastguard Worker # pylint: disable=line-too-long 1031*61c4878aSAndroid Build Coastguard Worker 'command': 'g++ -MMD -MF pw_strict_host_gcc_debug/obj/pw_base64/pw_base64.base64.cc.o.d -Wno-psabi -Og -Wshadow -Wredundant-decls -Wswitch-enum -Wpedantic -Wno-c++20-designator -Wno-gnu-zero-variadic-macro-arguments -fdiagnostics-color -g -fno-common -fno-exceptions -ffunction-sections -fdata-sections -Wall -Wextra -Wimplicit-fallthrough -Wcast-qual -Wundef -Wpointer-arith -Werror -Wno-error=cpp -Wno-error=deprecated-declarations -ffile-prefix-map=/pigweed/pigweed/out=out -ffile-prefix-map=/pigweed/pigweed/= -ffile-prefix-map=../= -ffile-prefix-map=/pigweed/pigweed/out=out -Wextra-semi -fno-rtti -Wnon-virtual-dtor -std=c++17 -Wno-register -DPW_SPAN_ENABLE_ASSERTS=true -I../pw_base64/public -I../pw_string/public -I../pw_assert/public -I../pw_assert/print_and_abort_assert_public_overrides -I../pw_preprocessor/public -I../pw_assert_basic/public_overrides -I../pw_assert_basic/public -I../pw_polyfill/public -I../pw_polyfill/standard_library_public -I../pw_span/public -c ../pw_base64/base64.cc -o pw_strict_host_gcc_debug/obj/pw_base64/pw_base64.base64.cc.o', 1032*61c4878aSAndroid Build Coastguard Worker 'directory': '/pigweed/pigweed/out', 1033*61c4878aSAndroid Build Coastguard Worker 'file': '../pw_base64/base64.cc', 1034*61c4878aSAndroid Build Coastguard Worker 'output': 'pw_strict_host_gcc_debug/obj/pw_base64/pw_base64.base64.cc.o', 1035*61c4878aSAndroid Build Coastguard Worker # pylint: enable=line-too-long 1036*61c4878aSAndroid Build Coastguard Worker }, 1037*61c4878aSAndroid Build Coastguard Worker { 1038*61c4878aSAndroid Build Coastguard Worker # pylint: disable=line-too-long 1039*61c4878aSAndroid Build Coastguard Worker 'command': 'g++ -MMD -MF pw_strict_host_gcc_debug/obj/pw_checksum/pw_checksum.crc32.cc.o.d -Wno-psabi -Og -Wshadow -Wredundant-decls -Wswitch-enum -Wpedantic -Wno-c++20-designator -Wno-gnu-zero-variadic-macro-arguments -fdiagnostics-color -g -fno-common -fno-exceptions -ffunction-sections -fdata-sections -Wall -Wextra -Wimplicit-fallthrough -Wcast-qual -Wundef -Wpointer-arith -Werror -Wno-error=cpp -Wno-error=deprecated-declarations -ffile-prefix-map=/pigweed/pigweed/out=out -ffile-prefix-map=/pigweed/pigweed/= -ffile-prefix-map=../= -ffile-prefix-map=/pigweed/pigweed/out=out -Wextra-semi -fno-rtti -Wnon-virtual-dtor -std=c++17 -Wno-register -DPW_SPAN_ENABLE_ASSERTS=true -DPW_STATUS_CFG_CHECK_IF_USED=1 -I../pw_checksum/public -I../pw_bytes/public -I../pw_containers/public -I../pw_polyfill/public -I../pw_polyfill/standard_library_public -I../pw_preprocessor/public -I../pw_span/public -I../pw_assert/public -I../pw_assert/print_and_abort_assert_public_overrides -I../pw_status/public -c ../pw_checksum/crc32.cc -o pw_strict_host_gcc_debug/obj/pw_checksum/pw_checksum.crc32.cc.o', 1040*61c4878aSAndroid Build Coastguard Worker 'directory': 'pigweed/pigweed/out', 1041*61c4878aSAndroid Build Coastguard Worker 'file': '../pw_checksum/crc32.cc', 1042*61c4878aSAndroid Build Coastguard Worker 'output': 'pw_strict_host_gcc_debug/obj/pw_checksum/pw_checksum.crc32.cc.o', 1043*61c4878aSAndroid Build Coastguard Worker # pylint: enable=line-too-long 1044*61c4878aSAndroid Build Coastguard Worker }, 1045*61c4878aSAndroid Build Coastguard Worker ] 1046*61c4878aSAndroid Build Coastguard Worker 1047*61c4878aSAndroid Build Coastguard Worker return super().setUp() 1048*61c4878aSAndroid Build Coastguard Worker 1049*61c4878aSAndroid Build Coastguard Worker def test_merge(self): 1050*61c4878aSAndroid Build Coastguard Worker compdb1 = CppCompilationDatabase.load( 1051*61c4878aSAndroid Build Coastguard Worker self.fixture_merge_1, self.root_dir 1052*61c4878aSAndroid Build Coastguard Worker ) 1053*61c4878aSAndroid Build Coastguard Worker compdb2 = CppCompilationDatabase.load( 1054*61c4878aSAndroid Build Coastguard Worker self.fixture_merge_2, self.root_dir 1055*61c4878aSAndroid Build Coastguard Worker ) 1056*61c4878aSAndroid Build Coastguard Worker compdb1.merge(compdb2) 1057*61c4878aSAndroid Build Coastguard Worker result = [compile_command.as_dict() for compile_command in compdb1] 1058*61c4878aSAndroid Build Coastguard Worker expected = [*self.fixture_merge_1, *self.fixture_merge_2] 1059*61c4878aSAndroid Build Coastguard Worker self.assertCountEqual(result, expected) 1060*61c4878aSAndroid Build Coastguard Worker 1061*61c4878aSAndroid Build Coastguard Worker def test_merge_no_dupes(self): 1062*61c4878aSAndroid Build Coastguard Worker compdb1 = CppCompilationDatabase.load( 1063*61c4878aSAndroid Build Coastguard Worker self.fixture_merge_1, self.root_dir 1064*61c4878aSAndroid Build Coastguard Worker ) 1065*61c4878aSAndroid Build Coastguard Worker fixture_combo = [*self.fixture_merge_1, *self.fixture_merge_2] 1066*61c4878aSAndroid Build Coastguard Worker compdb2 = CppCompilationDatabase.load(fixture_combo, self.root_dir) 1067*61c4878aSAndroid Build Coastguard Worker compdb1.merge(compdb2) 1068*61c4878aSAndroid Build Coastguard Worker result = [compile_command.as_dict() for compile_command in compdb1] 1069*61c4878aSAndroid Build Coastguard Worker expected = [*self.fixture_merge_1, *self.fixture_merge_2] 1070*61c4878aSAndroid Build Coastguard Worker self.assertCountEqual(result, expected) 1071*61c4878aSAndroid Build Coastguard Worker 1072*61c4878aSAndroid Build Coastguard Worker def test_load_from_dicts(self): 1073*61c4878aSAndroid Build Coastguard Worker compdb = CppCompilationDatabase.load(self.fixture, self.root_dir) 1074*61c4878aSAndroid Build Coastguard Worker self.assertCountEqual(compdb.as_dicts(), self.expected) 1075*61c4878aSAndroid Build Coastguard Worker 1076*61c4878aSAndroid Build Coastguard Worker def test_load_from_json(self): 1077*61c4878aSAndroid Build Coastguard Worker compdb = CppCompilationDatabase.load( 1078*61c4878aSAndroid Build Coastguard Worker json.dumps(self.fixture), self.root_dir 1079*61c4878aSAndroid Build Coastguard Worker ) 1080*61c4878aSAndroid Build Coastguard Worker self.assertCountEqual(compdb.as_dicts(), self.expected) 1081*61c4878aSAndroid Build Coastguard Worker 1082*61c4878aSAndroid Build Coastguard Worker def test_load_from_path(self): 1083*61c4878aSAndroid Build Coastguard Worker with self.make_temp_file( 1084*61c4878aSAndroid Build Coastguard Worker COMPDB_FILE_NAME, 1085*61c4878aSAndroid Build Coastguard Worker json.dumps(self.fixture), 1086*61c4878aSAndroid Build Coastguard Worker ) as (_, file_path): 1087*61c4878aSAndroid Build Coastguard Worker path = file_path 1088*61c4878aSAndroid Build Coastguard Worker 1089*61c4878aSAndroid Build Coastguard Worker compdb = CppCompilationDatabase.load(path, self.root_dir) 1090*61c4878aSAndroid Build Coastguard Worker self.assertCountEqual(compdb.as_dicts(), self.expected) 1091*61c4878aSAndroid Build Coastguard Worker 1092*61c4878aSAndroid Build Coastguard Worker def test_load_from_file_handle(self): 1093*61c4878aSAndroid Build Coastguard Worker with self.make_temp_file( 1094*61c4878aSAndroid Build Coastguard Worker COMPDB_FILE_NAME, 1095*61c4878aSAndroid Build Coastguard Worker json.dumps(self.fixture), 1096*61c4878aSAndroid Build Coastguard Worker ) as (file, _): 1097*61c4878aSAndroid Build Coastguard Worker compdb = CppCompilationDatabase.load(file, self.root_dir) 1098*61c4878aSAndroid Build Coastguard Worker 1099*61c4878aSAndroid Build Coastguard Worker self.assertCountEqual(compdb.as_dicts(), self.expected) 1100*61c4878aSAndroid Build Coastguard Worker 1101*61c4878aSAndroid Build Coastguard Worker def test_process(self): 1102*61c4878aSAndroid Build Coastguard Worker """Test processing against a typical sample of raw output from GN.""" 1103*61c4878aSAndroid Build Coastguard Worker 1104*61c4878aSAndroid Build Coastguard Worker targets = [ 1105*61c4878aSAndroid Build Coastguard Worker 'pw_strict_host_clang_debug', 1106*61c4878aSAndroid Build Coastguard Worker 'stm32f429i_disc1_debug', 1107*61c4878aSAndroid Build Coastguard Worker 'isosceles_debug', 1108*61c4878aSAndroid Build Coastguard Worker ] 1109*61c4878aSAndroid Build Coastguard Worker 1110*61c4878aSAndroid Build Coastguard Worker settings = self.make_ide_settings(targets_include=targets) 1111*61c4878aSAndroid Build Coastguard Worker 1112*61c4878aSAndroid Build Coastguard Worker # pylint: disable=line-too-long 1113*61c4878aSAndroid Build Coastguard Worker raw_db: list[CppCompileCommandDict] = [ 1114*61c4878aSAndroid Build Coastguard Worker { 1115*61c4878aSAndroid Build Coastguard Worker 'command': 'arm-none-eabi-g++ -MMD -MF stm32f429i_disc1_debug/obj/pw_allocator/block.block.cc.o.d -Wno-psabi -mabi=aapcs -mthumb --sysroot=../environment/cipd/packages/arm -specs=nano.specs -specs=nosys.specs -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Og -Wshadow -Wredundant-decls -u_printf_float -fdiagnostics-color -g -fno-common -fno-exceptions -ffunction-sections -fdata-sections -Wall -Wextra -Wimplicit-fallthrough -Wcast-qual -Wundef -Wpointer-arith -Werror -Wno-error=cpp -Wno-error=deprecated-declarations -ffile-prefix-map=/pigweed/pigweed/out=out -ffile-prefix-map=/pigweed/pigweed/= -ffile-prefix-map=../= -ffile-prefix-map=/pigweed/pigweed/out=out -fno-rtti -Wnon-virtual-dtor -std=c++17 -Wno-register -DPW_ARMV7M_ENABLE_FPU=1 -I../pw_allocator/public -I../pw_assert/public -I../pw_assert/assert_compatibility_public_overrides -I../pw_preprocessor/public -I../pw_assert_basic/public_overrides -I../pw_assert_basic/public -I../pw_span/public -I../pw_polyfill/public -I../pw_polyfill/standard_library_public -I../pw_status/public -c ../pw_allocator/block.cc -o stm32f429i_disc1_debug/obj/pw_allocator/block.block.cc.o', 1116*61c4878aSAndroid Build Coastguard Worker 'directory': str(self.root_dir), 1117*61c4878aSAndroid Build Coastguard Worker 'file': '../pw_allocator/block.cc', 1118*61c4878aSAndroid Build Coastguard Worker }, 1119*61c4878aSAndroid Build Coastguard Worker { 1120*61c4878aSAndroid Build Coastguard Worker 'command': '../environment/cipd/packages/pigweed/bin/isosceles-clang++ -MMD -MF isosceles_debug/obj/pw_allocator/block.block.cc.o.d -g3 --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -Og -Wshadow -Wredundant-decls -Wthread-safety -Wswitch-enum -fdiagnostics-color -g -fno-common -fno-exceptions -ffunction-sections -fdata-sections -Wall -Wextra -Wimplicit-fallthrough -Wcast-qual -Wundef -Wpointer-arith -Werror -Wno-error=cpp -Wno-error=deprecated-declarations -ffile-prefix-map=/pigweed/pigweed/out=out -ffile-prefix-map=/pigweed/pigweed/= -ffile-prefix-map=../= -ffile-prefix-map=/pigweed/pigweed/out=out -Wextra-semi -fno-rtti -Wnon-virtual-dtor -std=c++17 -Wno-register -D_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS=1 -DPW_STATUS_CFG_CHECK_IF_USED=1 -I../pw_allocator/public -I../pw_assert/public -I../pw_assert/print_and_abort_assert_public_overrides -I../pw_preprocessor/public -I../pw_assert_basic/public_overrides -I../pw_assert_basic/public -I../pw_span/public -I../pw_polyfill/public -I../pw_polyfill/standard_library_public -I../pw_status/public -c ../pw_allocator/block.cc -o isosceles_debug/obj/pw_allocator/block.block.cc.o', 1121*61c4878aSAndroid Build Coastguard Worker 'directory': str(self.root_dir), 1122*61c4878aSAndroid Build Coastguard Worker 'file': '../pw_allocator/block.cc', 1123*61c4878aSAndroid Build Coastguard Worker }, 1124*61c4878aSAndroid Build Coastguard Worker { 1125*61c4878aSAndroid Build Coastguard Worker 'command': 'ccache ../environment/cipd/packages/pigweed/bin/clang++ -MMD -MF pw_strict_host_clang_debug/obj/pw_allocator/block.block.cc.o.d -g3 --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -Og -Wshadow -Wredundant-decls -Wthread-safety -Wswitch-enum -fdiagnostics-color -g -fno-common -fno-exceptions -ffunction-sections -fdata-sections -Wall -Wextra -Wimplicit-fallthrough -Wcast-qual -Wundef -Wpointer-arith -Werror -Wno-error=cpp -Wno-error=deprecated-declarations -ffile-prefix-map=/pigweed/pigweed/out=out -ffile-prefix-map=/pigweed/pigweed/= -ffile-prefix-map=../= -ffile-prefix-map=/pigweed/pigweed/out=out -Wextra-semi -fno-rtti -Wnon-virtual-dtor -std=c++17 -Wno-register -D_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS=1 -DPW_STATUS_CFG_CHECK_IF_USED=1 -I../pw_allocator/public -I../pw_assert/public -I../pw_assert/print_and_abort_assert_public_overrides -I../pw_preprocessor/public -I../pw_assert_basic/public_overrides -I../pw_assert_basic/public -I../pw_span/public -I../pw_polyfill/public -I../pw_polyfill/standard_library_public -I../pw_status/public -c ../pw_allocator/block.cc -o pw_strict_host_clang_debug/obj/pw_allocator/block.block.cc.o', 1126*61c4878aSAndroid Build Coastguard Worker 'directory': str(self.root_dir), 1127*61c4878aSAndroid Build Coastguard Worker 'file': '../pw_allocator/block.cc', 1128*61c4878aSAndroid Build Coastguard Worker }, 1129*61c4878aSAndroid Build Coastguard Worker { 1130*61c4878aSAndroid Build Coastguard Worker 'command': "python ../pw_toolchain/py/pw_toolchain/clang_tidy.py --source-exclude 'third_party/.*' --source-exclude '.*packages/mbedtls.*' --source-exclude '.*packages/boringssl.*' --skip-include-path 'mbedtls/include' --skip-include-path 'mbedtls' --skip-include-path 'boringssl/src/include' --skip-include-path 'boringssl' --skip-include-path 'pw_tls_client/generate_test_data' --source-file ../pw_allocator/block.cc --source-root '../' --export-fixes pw_strict_host_clang_debug.static_analysis/obj/pw_allocator/block.block.cc.o.yaml -- ../environment/cipd/packages/pigweed/bin/clang++ END_OF_INVOKER -MMD -MF pw_strict_host_clang_debug.static_analysis/obj/pw_allocator/block.block.cc.o.d -g3 --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -Og -Wshadow -Wredundant-decls -Wthread-safety -Wswitch-enum -fdiagnostics-color -g -fno-common -fno-exceptions -ffunction-sections -fdata-sections -Wall -Wextra -Wimplicit-fallthrough -Wcast-qual -Wundef -Wpointer-arith -Werror -Wno-error=cpp -Wno-error=deprecated-declarations -ffile-prefix-map=/pigweed/pigweed/out=out -ffile-prefix-map=/pigweed/pigweed/= -ffile-prefix-map=../= -ffile-prefix-map=/pigweed/pigweed/out=out -Wextra-semi -fno-rtti -Wnon-virtual-dtor -std=c++17 -Wno-register -D_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS=1 -DPW_STATUS_CFG_CHECK_IF_USED=1 -I../pw_allocator/public -I../pw_assert/public -I../pw_assert/print_and_abort_assert_public_overrides -I../pw_preprocessor/public -I../pw_assert_basic/public_overrides -I../pw_assert_basic/public -I../pw_span/public -I../pw_polyfill/public -I../pw_polyfill/standard_library_public -I../pw_status/public -c ../pw_allocator/block.cc -o pw_strict_host_clang_debug.static_analysis/obj/pw_allocator/block.block.cc.o && touch pw_strict_host_clang_debug.static_analysis/obj/pw_allocator/block.block.cc.o", 1131*61c4878aSAndroid Build Coastguard Worker 'directory': str(self.root_dir), 1132*61c4878aSAndroid Build Coastguard Worker 'file': '../pw_allocator/block.cc', 1133*61c4878aSAndroid Build Coastguard Worker }, 1134*61c4878aSAndroid Build Coastguard Worker ] 1135*61c4878aSAndroid Build Coastguard Worker 1136*61c4878aSAndroid Build Coastguard Worker expected_compdbs = { 1137*61c4878aSAndroid Build Coastguard Worker 'isosceles_debug': [ 1138*61c4878aSAndroid Build Coastguard Worker { 1139*61c4878aSAndroid Build Coastguard Worker 'command': 1140*61c4878aSAndroid Build Coastguard Worker # Ensures path format matches OS (e.g. Windows) 1141*61c4878aSAndroid Build Coastguard Worker f'{Path("../environment/cipd/packages/pigweed/bin/isosceles-clang++")} -MMD -MF isosceles_debug/obj/pw_allocator/block.block.cc.o.d -g3 --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -Og -Wshadow -Wredundant-decls -Wthread-safety -Wswitch-enum -fdiagnostics-color -g -fno-common -fno-exceptions -ffunction-sections -fdata-sections -Wall -Wextra -Wimplicit-fallthrough -Wcast-qual -Wundef -Wpointer-arith -Werror -Wno-error=cpp -Wno-error=deprecated-declarations -ffile-prefix-map=/pigweed/pigweed/out=out -ffile-prefix-map=/pigweed/pigweed/= -ffile-prefix-map=../= -ffile-prefix-map=/pigweed/pigweed/out=out -Wextra-semi -fno-rtti -Wnon-virtual-dtor -std=c++17 -Wno-register -D_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS=1 -DPW_STATUS_CFG_CHECK_IF_USED=1 -I../pw_allocator/public -I../pw_assert/public -I../pw_assert/print_and_abort_assert_public_overrides -I../pw_preprocessor/public -I../pw_assert_basic/public_overrides -I../pw_assert_basic/public -I../pw_span/public -I../pw_polyfill/public -I../pw_polyfill/standard_library_public -I../pw_status/public -c ../pw_allocator/block.cc -o isosceles_debug/obj/pw_allocator/block.block.cc.o', 1142*61c4878aSAndroid Build Coastguard Worker 'directory': str(self.root_dir), 1143*61c4878aSAndroid Build Coastguard Worker 'file': '../pw_allocator/block.cc', 1144*61c4878aSAndroid Build Coastguard Worker 'output': 'isosceles_debug/obj/pw_allocator/block.block.cc.o', 1145*61c4878aSAndroid Build Coastguard Worker }, 1146*61c4878aSAndroid Build Coastguard Worker ], 1147*61c4878aSAndroid Build Coastguard Worker 'pw_strict_host_clang_debug': [ 1148*61c4878aSAndroid Build Coastguard Worker { 1149*61c4878aSAndroid Build Coastguard Worker 'command': 1150*61c4878aSAndroid Build Coastguard Worker # Ensures path format matches OS (e.g. Windows) 1151*61c4878aSAndroid Build Coastguard Worker f'ccache {Path("../environment/cipd/packages/pigweed/bin/clang++")} -MMD -MF pw_strict_host_clang_debug/obj/pw_allocator/block.block.cc.o.d -g3 --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -Og -Wshadow -Wredundant-decls -Wthread-safety -Wswitch-enum -fdiagnostics-color -g -fno-common -fno-exceptions -ffunction-sections -fdata-sections -Wall -Wextra -Wimplicit-fallthrough -Wcast-qual -Wundef -Wpointer-arith -Werror -Wno-error=cpp -Wno-error=deprecated-declarations -ffile-prefix-map=/pigweed/pigweed/out=out -ffile-prefix-map=/pigweed/pigweed/= -ffile-prefix-map=../= -ffile-prefix-map=/pigweed/pigweed/out=out -Wextra-semi -fno-rtti -Wnon-virtual-dtor -std=c++17 -Wno-register -D_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS=1 -DPW_STATUS_CFG_CHECK_IF_USED=1 -I../pw_allocator/public -I../pw_assert/public -I../pw_assert/print_and_abort_assert_public_overrides -I../pw_preprocessor/public -I../pw_assert_basic/public_overrides -I../pw_assert_basic/public -I../pw_span/public -I../pw_polyfill/public -I../pw_polyfill/standard_library_public -I../pw_status/public -c ../pw_allocator/block.cc -o pw_strict_host_clang_debug/obj/pw_allocator/block.block.cc.o', 1152*61c4878aSAndroid Build Coastguard Worker 'directory': str(self.root_dir), 1153*61c4878aSAndroid Build Coastguard Worker 'file': '../pw_allocator/block.cc', 1154*61c4878aSAndroid Build Coastguard Worker 'output': 'pw_strict_host_clang_debug/obj/pw_allocator/block.block.cc.o', 1155*61c4878aSAndroid Build Coastguard Worker }, 1156*61c4878aSAndroid Build Coastguard Worker ], 1157*61c4878aSAndroid Build Coastguard Worker 'stm32f429i_disc1_debug': [ 1158*61c4878aSAndroid Build Coastguard Worker { 1159*61c4878aSAndroid Build Coastguard Worker 'command': 1160*61c4878aSAndroid Build Coastguard Worker # Ensures this test avoids the unpathed compiler search 1161*61c4878aSAndroid Build Coastguard Worker f'{self.temp_dir_path / "arm-none-eabi-g++"} -MMD -MF stm32f429i_disc1_debug/obj/pw_allocator/block.block.cc.o.d -Wno-psabi -mabi=aapcs -mthumb --sysroot=../environment/cipd/packages/arm -specs=nano.specs -specs=nosys.specs -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Og -Wshadow -Wredundant-decls -u_printf_float -fdiagnostics-color -g -fno-common -fno-exceptions -ffunction-sections -fdata-sections -Wall -Wextra -Wimplicit-fallthrough -Wcast-qual -Wundef -Wpointer-arith -Werror -Wno-error=cpp -Wno-error=deprecated-declarations -ffile-prefix-map=/pigweed/pigweed/out=out -ffile-prefix-map=/pigweed/pigweed/= -ffile-prefix-map=../= -ffile-prefix-map=/pigweed/pigweed/out=out -fno-rtti -Wnon-virtual-dtor -std=c++17 -Wno-register -DPW_ARMV7M_ENABLE_FPU=1 -I../pw_allocator/public -I../pw_assert/public -I../pw_assert/assert_compatibility_public_overrides -I../pw_preprocessor/public -I../pw_assert_basic/public_overrides -I../pw_assert_basic/public -I../pw_span/public -I../pw_polyfill/public -I../pw_polyfill/standard_library_public -I../pw_status/public -c ../pw_allocator/block.cc -o stm32f429i_disc1_debug/obj/pw_allocator/block.block.cc.o', 1162*61c4878aSAndroid Build Coastguard Worker 'directory': str(self.root_dir), 1163*61c4878aSAndroid Build Coastguard Worker 'file': '../pw_allocator/block.cc', 1164*61c4878aSAndroid Build Coastguard Worker 'output': 'stm32f429i_disc1_debug/obj/pw_allocator/block.block.cc.o', 1165*61c4878aSAndroid Build Coastguard Worker }, 1166*61c4878aSAndroid Build Coastguard Worker ], 1167*61c4878aSAndroid Build Coastguard Worker } 1168*61c4878aSAndroid Build Coastguard Worker # pylint: enable=line-too-long 1169*61c4878aSAndroid Build Coastguard Worker 1170*61c4878aSAndroid Build Coastguard Worker compdbs = CppCompilationDatabase.load( 1171*61c4878aSAndroid Build Coastguard Worker raw_db, root_dir=self.root_dir 1172*61c4878aSAndroid Build Coastguard Worker ).process(settings, default_path=self.temp_dir_path) 1173*61c4878aSAndroid Build Coastguard Worker compdbs_as_dicts = { 1174*61c4878aSAndroid Build Coastguard Worker target: compdb.as_dicts() for target, compdb in compdbs.items() 1175*61c4878aSAndroid Build Coastguard Worker } 1176*61c4878aSAndroid Build Coastguard Worker 1177*61c4878aSAndroid Build Coastguard Worker self.assertCountEqual( 1178*61c4878aSAndroid Build Coastguard Worker list(compdbs_as_dicts.keys()), list(expected_compdbs.keys()) 1179*61c4878aSAndroid Build Coastguard Worker ) 1180*61c4878aSAndroid Build Coastguard Worker self.assertDictEqual(compdbs_as_dicts, expected_compdbs) 1181*61c4878aSAndroid Build Coastguard Worker 1182*61c4878aSAndroid Build Coastguard Worker 1183*61c4878aSAndroid Build Coastguard Workerclass TestCppCompilationDatabasesMap(PwIdeTestCase): 1184*61c4878aSAndroid Build Coastguard Worker """Tests CppCompilationDatabasesMap""" 1185*61c4878aSAndroid Build Coastguard Worker 1186*61c4878aSAndroid Build Coastguard Worker def setUp(self): 1187*61c4878aSAndroid Build Coastguard Worker # pylint: disable=line-too-long 1188*61c4878aSAndroid Build Coastguard Worker self.fixture_1 = lambda target: [ 1189*61c4878aSAndroid Build Coastguard Worker CppCompileCommand( 1190*61c4878aSAndroid Build Coastguard Worker **{ 1191*61c4878aSAndroid Build Coastguard Worker 'command': f'g++ -MMD -MF {target}/obj/pw_allocator/block.block.cc.o.d -Wno-psabi -Og -Wshadow -Wredundant-decls -Wswitch-enum -Wpedantic -Wno-c++20-designator -Wno-gnu-zero-variadic-macro-arguments -fdiagnostics-color -g -fno-common -fno-exceptions -ffunction-sections -fdata-sections -Wall -Wextra -Wimplicit-fallthrough -Wcast-qual -Wundef -Wpointer-arith -Werror -Wno-error=cpp -Wno-error=deprecated-declarations -ffile-prefix-map=/pigweed/pigweed/out=out -ffile-prefix-map=/pigweed/pigweed/= -ffile-prefix-map=../= -ffile-prefix-map=/pigweed/pigweed/out=out -Wextra-semi -fno-rtti -Wnon-virtual-dtor -std=c++17 -Wno-register -DPW_SPAN_ENABLE_ASSERTS=true -DPW_STATUS_CFG_CHECK_IF_USED=1 -I../pw_allocator/public -I../pw_assert/public -I../pw_assert/print_and_abort_assert_public_overrides -I../pw_preprocessor/public -I../pw_assert_basic/public_overrides -I../pw_assert_basic/public -I../pw_span/public -I../pw_polyfill/public -I../pw_polyfill/standard_library_public -I../pw_status/public -c ../pw_allocator/block.cc -o pw_strict_host_gcc_debug/obj/pw_allocator/block.block.cc.o', 1192*61c4878aSAndroid Build Coastguard Worker 'directory': '/pigweed/pigweed/out', 1193*61c4878aSAndroid Build Coastguard Worker 'file': '../pw_allocator/block.cc', 1194*61c4878aSAndroid Build Coastguard Worker } 1195*61c4878aSAndroid Build Coastguard Worker ), 1196*61c4878aSAndroid Build Coastguard Worker CppCompileCommand( 1197*61c4878aSAndroid Build Coastguard Worker **{ 1198*61c4878aSAndroid Build Coastguard Worker 'command': f'g++ -MMD -MF {target}/obj/pw_allocator/freelist.freelist.cc.o.d -Wno-psabi -Og -Wshadow -Wredundant-decls -Wswitch-enum -Wpedantic -Wno-c++20-designator -Wno-gnu-zero-variadic-macro-arguments -fdiagnostics-color -g -fno-common -fno-exceptions -ffunction-sections -fdata-sections -Wall -Wextra -Wimplicit-fallthrough -Wcast-qual -Wundef -Wpointer-arith -Werror -Wno-error=cpp -Wno-error=deprecated-declarations -ffile-prefix-map=//pigweed/pigweed/out=out -ffile-prefix-map=/pigweed/pigweed/= -ffile-prefix-map=../= -ffile-prefix-map=/pigweed/pigweed/out=out -Wextra-semi -fno-rtti -Wnon-virtual-dtor -std=c++17 -Wno-register -DPW_SPAN_ENABLE_ASSERTS=true -DPW_STATUS_CFG_CHECK_IF_USED=1 -I../pw_allocator/public -I../pw_containers/public -I../pw_assert/public -I../pw_assert/print_and_abort_assert_public_overrides -I../pw_preprocessor/public -I../pw_assert_basic/public_overrides -I../pw_assert_basic/public -I../pw_polyfill/public -I../pw_polyfill/standard_library_public -I../pw_span/public -I../pw_status/public -c ../pw_allocator/freelist.cc -o pw_strict_host_gcc_debug/obj/pw_allocator/freelist.freelist.cc.o', 1199*61c4878aSAndroid Build Coastguard Worker 'directory': '/pigweed/pigweed/out', 1200*61c4878aSAndroid Build Coastguard Worker 'file': '../pw_allocator/freelist.cc', 1201*61c4878aSAndroid Build Coastguard Worker } 1202*61c4878aSAndroid Build Coastguard Worker ), 1203*61c4878aSAndroid Build Coastguard Worker ] 1204*61c4878aSAndroid Build Coastguard Worker 1205*61c4878aSAndroid Build Coastguard Worker self.fixture_2 = lambda target: [ 1206*61c4878aSAndroid Build Coastguard Worker CppCompileCommand( 1207*61c4878aSAndroid Build Coastguard Worker **{ 1208*61c4878aSAndroid Build Coastguard Worker 'command': f'g++ -MMD -MF {target}/obj/pw_base64/pw_base64.base64.cc.o.d -Wno-psabi -Og -Wshadow -Wredundant-decls -Wswitch-enum -Wpedantic -Wno-c++20-designator -Wno-gnu-zero-variadic-macro-arguments -fdiagnostics-color -g -fno-common -fno-exceptions -ffunction-sections -fdata-sections -Wall -Wextra -Wimplicit-fallthrough -Wcast-qual -Wundef -Wpointer-arith -Werror -Wno-error=cpp -Wno-error=deprecated-declarations -ffile-prefix-map=/pigweed/pigweed/out=out -ffile-prefix-map=/pigweed/pigweed/= -ffile-prefix-map=../= -ffile-prefix-map=/pigweed/pigweed/out=out -Wextra-semi -fno-rtti -Wnon-virtual-dtor -std=c++17 -Wno-register -DPW_SPAN_ENABLE_ASSERTS=true -I../pw_base64/public -I../pw_string/public -I../pw_assert/public -I../pw_assert/print_and_abort_assert_public_overrides -I../pw_preprocessor/public -I../pw_assert_basic/public_overrides -I../pw_assert_basic/public -I../pw_polyfill/public -I../pw_polyfill/standard_library_public -I../pw_span/public -c ../pw_base64/base64.cc -o pw_strict_host_gcc_debug/obj/pw_base64/pw_base64.base64.cc.o', 1209*61c4878aSAndroid Build Coastguard Worker 'directory': '/pigweed/pigweed/out', 1210*61c4878aSAndroid Build Coastguard Worker 'file': '../pw_base64/base64.cc', 1211*61c4878aSAndroid Build Coastguard Worker } 1212*61c4878aSAndroid Build Coastguard Worker ), 1213*61c4878aSAndroid Build Coastguard Worker CppCompileCommand( 1214*61c4878aSAndroid Build Coastguard Worker **{ 1215*61c4878aSAndroid Build Coastguard Worker 'command': f'g++ -MMD -MF {target}/obj/pw_checksum/pw_checksum.crc32.cc.o.d -Wno-psabi -Og -Wshadow -Wredundant-decls -Wswitch-enum -Wpedantic -Wno-c++20-designator -Wno-gnu-zero-variadic-macro-arguments -fdiagnostics-color -g -fno-common -fno-exceptions -ffunction-sections -fdata-sections -Wall -Wextra -Wimplicit-fallthrough -Wcast-qual -Wundef -Wpointer-arith -Werror -Wno-error=cpp -Wno-error=deprecated-declarations -ffile-prefix-map=/pigweed/pigweed/out=out -ffile-prefix-map=/pigweed/pigweed/= -ffile-prefix-map=../= -ffile-prefix-map=/pigweed/pigweed/out=out -Wextra-semi -fno-rtti -Wnon-virtual-dtor -std=c++17 -Wno-register -DPW_SPAN_ENABLE_ASSERTS=true -DPW_STATUS_CFG_CHECK_IF_USED=1 -I../pw_checksum/public -I../pw_bytes/public -I../pw_containers/public -I../pw_polyfill/public -I../pw_polyfill/standard_library_public -I../pw_preprocessor/public -I../pw_span/public -I../pw_assert/public -I../pw_assert/print_and_abort_assert_public_overrides -I../pw_status/public -c ../pw_checksum/crc32.cc -o pw_strict_host_gcc_debug/obj/pw_checksum/pw_checksum.crc32.cc.o', 1216*61c4878aSAndroid Build Coastguard Worker 'directory': 'pigweed/pigweed/out', 1217*61c4878aSAndroid Build Coastguard Worker 'file': '../pw_checksum/crc32.cc', 1218*61c4878aSAndroid Build Coastguard Worker } 1219*61c4878aSAndroid Build Coastguard Worker ), 1220*61c4878aSAndroid Build Coastguard Worker ] 1221*61c4878aSAndroid Build Coastguard Worker # pylint: enable=line-too-long 1222*61c4878aSAndroid Build Coastguard Worker super().setUp() 1223*61c4878aSAndroid Build Coastguard Worker 1224*61c4878aSAndroid Build Coastguard Worker def test_merge_0_db_set(self): 1225*61c4878aSAndroid Build Coastguard Worker with self.assertRaises(ValueError): 1226*61c4878aSAndroid Build Coastguard Worker CppCompilationDatabasesMap.merge() 1227*61c4878aSAndroid Build Coastguard Worker 1228*61c4878aSAndroid Build Coastguard Worker def test_merge_1_db_set(self): 1229*61c4878aSAndroid Build Coastguard Worker settings = self.make_ide_settings() 1230*61c4878aSAndroid Build Coastguard Worker target = 'test_target' 1231*61c4878aSAndroid Build Coastguard Worker db_set = CppCompilationDatabasesMap(settings) 1232*61c4878aSAndroid Build Coastguard Worker db_set[target] = self.fixture_1(target) 1233*61c4878aSAndroid Build Coastguard Worker result = CppCompilationDatabasesMap.merge(db_set) 1234*61c4878aSAndroid Build Coastguard Worker self.assertCountEqual(result._dbs, db_set._dbs) 1235*61c4878aSAndroid Build Coastguard Worker 1236*61c4878aSAndroid Build Coastguard Worker def test_merge_2_db_sets_different_targets(self): 1237*61c4878aSAndroid Build Coastguard Worker settings = self.make_ide_settings() 1238*61c4878aSAndroid Build Coastguard Worker target1 = 'test_target_1' 1239*61c4878aSAndroid Build Coastguard Worker target2 = 'test_target_2' 1240*61c4878aSAndroid Build Coastguard Worker db_set1 = CppCompilationDatabasesMap(settings) 1241*61c4878aSAndroid Build Coastguard Worker db_set1[target1] = self.fixture_1(target1) 1242*61c4878aSAndroid Build Coastguard Worker db_set2 = CppCompilationDatabasesMap(settings) 1243*61c4878aSAndroid Build Coastguard Worker db_set2[target2] = self.fixture_2(target2) 1244*61c4878aSAndroid Build Coastguard Worker result = CppCompilationDatabasesMap.merge(db_set1, db_set2) 1245*61c4878aSAndroid Build Coastguard Worker self.assertEqual(len(result), 2) 1246*61c4878aSAndroid Build Coastguard Worker self.assertCountEqual(result._dbs, {**db_set1._dbs, **db_set2._dbs}) 1247*61c4878aSAndroid Build Coastguard Worker 1248*61c4878aSAndroid Build Coastguard Worker def test_merge_2_db_sets_duplicated_targets(self): 1249*61c4878aSAndroid Build Coastguard Worker settings = self.make_ide_settings() 1250*61c4878aSAndroid Build Coastguard Worker target1 = 'test_target_1' 1251*61c4878aSAndroid Build Coastguard Worker target2 = 'test_target_2' 1252*61c4878aSAndroid Build Coastguard Worker db_set1 = CppCompilationDatabasesMap(settings) 1253*61c4878aSAndroid Build Coastguard Worker db_set1[target1] = self.fixture_1(target1) 1254*61c4878aSAndroid Build Coastguard Worker db_set2 = CppCompilationDatabasesMap(settings) 1255*61c4878aSAndroid Build Coastguard Worker db_set2[target2] = self.fixture_2(target2) 1256*61c4878aSAndroid Build Coastguard Worker db_set_combo = CppCompilationDatabasesMap.merge(db_set1, db_set2) 1257*61c4878aSAndroid Build Coastguard Worker result = CppCompilationDatabasesMap.merge(db_set1, db_set_combo) 1258*61c4878aSAndroid Build Coastguard Worker self.assertEqual(len(result), 2) 1259*61c4878aSAndroid Build Coastguard Worker self.assertCountEqual(result._dbs, {**db_set1._dbs, **db_set2._dbs}) 1260*61c4878aSAndroid Build Coastguard Worker 1261*61c4878aSAndroid Build Coastguard Worker def test_cascade_disabled(self): 1262*61c4878aSAndroid Build Coastguard Worker settings = self.make_ide_settings( 1263*61c4878aSAndroid Build Coastguard Worker cascade_targets=False, 1264*61c4878aSAndroid Build Coastguard Worker targets_include=['test_target_1', 'test_target_2'], 1265*61c4878aSAndroid Build Coastguard Worker ) 1266*61c4878aSAndroid Build Coastguard Worker target1 = 'test_target_1' 1267*61c4878aSAndroid Build Coastguard Worker target2 = 'test_target_2' 1268*61c4878aSAndroid Build Coastguard Worker db_set = CppCompilationDatabasesMap(settings) 1269*61c4878aSAndroid Build Coastguard Worker db_set[target1] = self.fixture_1(target1) 1270*61c4878aSAndroid Build Coastguard Worker db_set[target2] = self.fixture_2(target2) 1271*61c4878aSAndroid Build Coastguard Worker result = db_set._compdb_to_write(target1) 1272*61c4878aSAndroid Build Coastguard Worker self.assertCountEqual(result._db, [*db_set[target1]]) 1273*61c4878aSAndroid Build Coastguard Worker 1274*61c4878aSAndroid Build Coastguard Worker def test_cascade_enabled(self): 1275*61c4878aSAndroid Build Coastguard Worker settings = self.make_ide_settings( 1276*61c4878aSAndroid Build Coastguard Worker cascade_targets=True, 1277*61c4878aSAndroid Build Coastguard Worker targets_include=['test_target_1', 'test_target_2'], 1278*61c4878aSAndroid Build Coastguard Worker ) 1279*61c4878aSAndroid Build Coastguard Worker target1 = 'test_target_1' 1280*61c4878aSAndroid Build Coastguard Worker target2 = 'test_target_2' 1281*61c4878aSAndroid Build Coastguard Worker db_set = CppCompilationDatabasesMap(settings) 1282*61c4878aSAndroid Build Coastguard Worker db_set[target1] = self.fixture_1(target1) 1283*61c4878aSAndroid Build Coastguard Worker db_set[target2] = self.fixture_2(target2) 1284*61c4878aSAndroid Build Coastguard Worker result = db_set._compdb_to_write(target1) 1285*61c4878aSAndroid Build Coastguard Worker self.assertCountEqual(result._db, [*db_set[target1], *db_set[target2]]) 1286*61c4878aSAndroid Build Coastguard Worker 1287*61c4878aSAndroid Build Coastguard Worker 1288*61c4878aSAndroid Build Coastguard Workerclass TestCppIdeFeaturesState(PwIdeTestCase): 1289*61c4878aSAndroid Build Coastguard Worker """Test CppIdeFeaturesState""" 1290*61c4878aSAndroid Build Coastguard Worker 1291*61c4878aSAndroid Build Coastguard Worker def test_targets_all(self): 1292*61c4878aSAndroid Build Coastguard Worker all_targets = { 1293*61c4878aSAndroid Build Coastguard Worker "a": CppIdeFeaturesTarget("a", Path("/dev/null"), 1), 1294*61c4878aSAndroid Build Coastguard Worker "b": CppIdeFeaturesTarget("b", Path("/dev/null"), 1), 1295*61c4878aSAndroid Build Coastguard Worker "c": CppIdeFeaturesTarget("c", Path("/dev/null"), 1), 1296*61c4878aSAndroid Build Coastguard Worker } 1297*61c4878aSAndroid Build Coastguard Worker 1298*61c4878aSAndroid Build Coastguard Worker settings = self.make_ide_settings() 1299*61c4878aSAndroid Build Coastguard Worker state = CppIdeFeaturesState(settings) 1300*61c4878aSAndroid Build Coastguard Worker state.targets = all_targets 1301*61c4878aSAndroid Build Coastguard Worker self.assertListEqual(list(state.targets.keys()), ["a", "b", "c"]) 1302*61c4878aSAndroid Build Coastguard Worker 1303*61c4878aSAndroid Build Coastguard Worker def test_targets_exclude(self): 1304*61c4878aSAndroid Build Coastguard Worker all_targets = { 1305*61c4878aSAndroid Build Coastguard Worker "a": CppIdeFeaturesTarget("a", Path("/dev/null"), 1), 1306*61c4878aSAndroid Build Coastguard Worker "b": CppIdeFeaturesTarget("b", Path("/dev/null"), 1), 1307*61c4878aSAndroid Build Coastguard Worker "c": CppIdeFeaturesTarget("c", Path("/dev/null"), 1), 1308*61c4878aSAndroid Build Coastguard Worker } 1309*61c4878aSAndroid Build Coastguard Worker 1310*61c4878aSAndroid Build Coastguard Worker settings = self.make_ide_settings(targets_exclude=["a"]) 1311*61c4878aSAndroid Build Coastguard Worker state = CppIdeFeaturesState(settings) 1312*61c4878aSAndroid Build Coastguard Worker state.targets = all_targets 1313*61c4878aSAndroid Build Coastguard Worker self.assertListEqual(list(state.targets.keys()), ["b", "c"]) 1314*61c4878aSAndroid Build Coastguard Worker 1315*61c4878aSAndroid Build Coastguard Worker def test_targets_include(self): 1316*61c4878aSAndroid Build Coastguard Worker all_targets = { 1317*61c4878aSAndroid Build Coastguard Worker "a": CppIdeFeaturesTarget("a", Path("/dev/null"), 1), 1318*61c4878aSAndroid Build Coastguard Worker "b": CppIdeFeaturesTarget("b", Path("/dev/null"), 1), 1319*61c4878aSAndroid Build Coastguard Worker "c": CppIdeFeaturesTarget("c", Path("/dev/null"), 1), 1320*61c4878aSAndroid Build Coastguard Worker } 1321*61c4878aSAndroid Build Coastguard Worker 1322*61c4878aSAndroid Build Coastguard Worker settings = self.make_ide_settings(targets_include=["a"]) 1323*61c4878aSAndroid Build Coastguard Worker state = CppIdeFeaturesState(settings) 1324*61c4878aSAndroid Build Coastguard Worker state.targets = all_targets 1325*61c4878aSAndroid Build Coastguard Worker self.assertListEqual(list(state.targets.keys()), ["a"]) 1326*61c4878aSAndroid Build Coastguard Worker 1327*61c4878aSAndroid Build Coastguard Worker 1328*61c4878aSAndroid Build Coastguard Workerif __name__ == '__main__': 1329*61c4878aSAndroid Build Coastguard Worker unittest.main() 1330