@@ -74,6 +74,10 @@ func TestIncludesToIncludeFolders(t *testing.T) {
7474 importedLibraries := context [constants .CTX_IMPORTED_LIBRARIES ].([]* types.Library )
7575 require .Equal (t , 1 , len (importedLibraries ))
7676 require .Equal (t , "Bridge" , importedLibraries [0 ].Name )
77+
78+ libraryResolutionResults := context [constants .CTX_LIBRARY_RESOLUTION_RESULTS ].(map [string ]types.LibraryResolutionResult )
79+ require .NotNil (t , libraryResolutionResults )
80+ require .False (t , libraryResolutionResults ["Bridge.h" ].IsLibraryFromPlatform )
7781}
7882
7983func TestIncludesToIncludeFoldersSketchWithIfDef (t * testing.T ) {
@@ -109,6 +113,9 @@ func TestIncludesToIncludeFoldersSketchWithIfDef(t *testing.T) {
109113
110114 importedLibraries := context [constants .CTX_IMPORTED_LIBRARIES ].([]* types.Library )
111115 require .Equal (t , 0 , len (importedLibraries ))
116+
117+ libraryResolutionResults := context [constants .CTX_LIBRARY_RESOLUTION_RESULTS ].(map [string ]types.LibraryResolutionResult )
118+ require .NotNil (t , libraryResolutionResults )
112119}
113120
114121func TestIncludesToIncludeFoldersIRremoteLibrary (t * testing.T ) {
@@ -147,6 +154,11 @@ func TestIncludesToIncludeFoldersIRremoteLibrary(t *testing.T) {
147154 require .Equal (t , 2 , len (importedLibraries ))
148155 require .Equal (t , "Bridge" , importedLibraries [0 ].Name )
149156 require .Equal (t , "IRremote" , importedLibraries [1 ].Name )
157+
158+ libraryResolutionResults := context [constants .CTX_LIBRARY_RESOLUTION_RESULTS ].(map [string ]types.LibraryResolutionResult )
159+ require .NotNil (t , libraryResolutionResults )
160+ require .False (t , libraryResolutionResults ["Bridge.h" ].IsLibraryFromPlatform )
161+ require .False (t , libraryResolutionResults ["IRremote.h" ].IsLibraryFromPlatform )
150162}
151163
152164func TestIncludesToIncludeFoldersANewLibrary (t * testing.T ) {
@@ -185,6 +197,11 @@ func TestIncludesToIncludeFoldersANewLibrary(t *testing.T) {
185197 require .Equal (t , 2 , len (importedLibraries ))
186198 require .Equal (t , "ANewLibrary-master" , importedLibraries [0 ].Name )
187199 require .Equal (t , "IRremote" , importedLibraries [1 ].Name )
200+
201+ libraryResolutionResults := context [constants .CTX_LIBRARY_RESOLUTION_RESULTS ].(map [string ]types.LibraryResolutionResult )
202+ require .NotNil (t , libraryResolutionResults )
203+ require .False (t , libraryResolutionResults ["anewlibrary.h" ].IsLibraryFromPlatform )
204+ require .False (t , libraryResolutionResults ["IRremote.h" ].IsLibraryFromPlatform )
188205}
189206
190207func TestIncludesToIncludeFoldersDuplicateLibs (t * testing.T ) {
@@ -223,6 +240,10 @@ func TestIncludesToIncludeFoldersDuplicateLibs(t *testing.T) {
223240 require .Equal (t , 1 , len (importedLibraries ))
224241 require .Equal (t , "SPI" , importedLibraries [0 ].Name )
225242 require .Equal (t , Abs (t , filepath .Join ("user_hardware" , "my_avr_platform" , "avr" , "libraries" , "SPI" )), importedLibraries [0 ].SrcFolder )
243+
244+ libraryResolutionResults := context [constants .CTX_LIBRARY_RESOLUTION_RESULTS ].(map [string ]types.LibraryResolutionResult )
245+ require .NotNil (t , libraryResolutionResults )
246+ require .True (t , libraryResolutionResults ["SPI.h" ].IsLibraryFromPlatform )
226247}
227248
228249func TestIncludesToIncludeFoldersDuplicateLibsWithConflictingLibsOutsideOfPlatform (t * testing.T ) {
@@ -261,6 +282,10 @@ func TestIncludesToIncludeFoldersDuplicateLibsWithConflictingLibsOutsideOfPlatfo
261282 require .Equal (t , 1 , len (importedLibraries ))
262283 require .Equal (t , "SPI" , importedLibraries [0 ].Name )
263284 require .Equal (t , Abs (t , filepath .Join ("libraries" , "SPI" )), importedLibraries [0 ].SrcFolder )
285+
286+ libraryResolutionResults := context [constants .CTX_LIBRARY_RESOLUTION_RESULTS ].(map [string ]types.LibraryResolutionResult )
287+ require .NotNil (t , libraryResolutionResults )
288+ require .False (t , libraryResolutionResults ["SPI.h" ].IsLibraryFromPlatform )
264289}
265290
266291func TestIncludesToIncludeFoldersDuplicateLibs2 (t * testing.T ) {
@@ -298,4 +323,8 @@ func TestIncludesToIncludeFoldersDuplicateLibs2(t *testing.T) {
298323 require .Equal (t , 1 , len (importedLibraries ))
299324 require .Equal (t , "USBHost" , importedLibraries [0 ].Name )
300325 require .Equal (t , Abs (t , filepath .Join ("libraries" , "USBHost" , "src" )), importedLibraries [0 ].SrcFolder )
326+
327+ libraryResolutionResults := context [constants .CTX_LIBRARY_RESOLUTION_RESULTS ].(map [string ]types.LibraryResolutionResult )
328+ require .NotNil (t , libraryResolutionResults )
329+ require .False (t , libraryResolutionResults ["Usb.h" ].IsLibraryFromPlatform )
301330}
0 commit comments