@@ -74,6 +74,10 @@ func TestIncludesToIncludeFolders(t *testing.T) {
74
74
importedLibraries := context [constants .CTX_IMPORTED_LIBRARIES ].([]* types.Library )
75
75
require .Equal (t , 1 , len (importedLibraries ))
76
76
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 )
77
81
}
78
82
79
83
func TestIncludesToIncludeFoldersSketchWithIfDef (t * testing.T ) {
@@ -109,6 +113,9 @@ func TestIncludesToIncludeFoldersSketchWithIfDef(t *testing.T) {
109
113
110
114
importedLibraries := context [constants .CTX_IMPORTED_LIBRARIES ].([]* types.Library )
111
115
require .Equal (t , 0 , len (importedLibraries ))
116
+
117
+ libraryResolutionResults := context [constants .CTX_LIBRARY_RESOLUTION_RESULTS ].(map [string ]types.LibraryResolutionResult )
118
+ require .NotNil (t , libraryResolutionResults )
112
119
}
113
120
114
121
func TestIncludesToIncludeFoldersIRremoteLibrary (t * testing.T ) {
@@ -147,6 +154,11 @@ func TestIncludesToIncludeFoldersIRremoteLibrary(t *testing.T) {
147
154
require .Equal (t , 2 , len (importedLibraries ))
148
155
require .Equal (t , "Bridge" , importedLibraries [0 ].Name )
149
156
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 )
150
162
}
151
163
152
164
func TestIncludesToIncludeFoldersANewLibrary (t * testing.T ) {
@@ -185,6 +197,11 @@ func TestIncludesToIncludeFoldersANewLibrary(t *testing.T) {
185
197
require .Equal (t , 2 , len (importedLibraries ))
186
198
require .Equal (t , "ANewLibrary-master" , importedLibraries [0 ].Name )
187
199
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 )
188
205
}
189
206
190
207
func TestIncludesToIncludeFoldersDuplicateLibs (t * testing.T ) {
@@ -223,6 +240,10 @@ func TestIncludesToIncludeFoldersDuplicateLibs(t *testing.T) {
223
240
require .Equal (t , 1 , len (importedLibraries ))
224
241
require .Equal (t , "SPI" , importedLibraries [0 ].Name )
225
242
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 )
226
247
}
227
248
228
249
func TestIncludesToIncludeFoldersDuplicateLibsWithConflictingLibsOutsideOfPlatform (t * testing.T ) {
@@ -261,6 +282,10 @@ func TestIncludesToIncludeFoldersDuplicateLibsWithConflictingLibsOutsideOfPlatfo
261
282
require .Equal (t , 1 , len (importedLibraries ))
262
283
require .Equal (t , "SPI" , importedLibraries [0 ].Name )
263
284
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 )
264
289
}
265
290
266
291
func TestIncludesToIncludeFoldersDuplicateLibs2 (t * testing.T ) {
@@ -298,4 +323,8 @@ func TestIncludesToIncludeFoldersDuplicateLibs2(t *testing.T) {
298
323
require .Equal (t , 1 , len (importedLibraries ))
299
324
require .Equal (t , "USBHost" , importedLibraries [0 ].Name )
300
325
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 )
301
330
}
0 commit comments