@@ -220,16 +220,36 @@ func compileWithSketchWithSymlinkSelfloop(t *testing.T, env *integrationtest.Env
220
220
require .NoError (t , err )
221
221
require .Contains (t , string (stdout ), "Sketch created in: " + sketchPath .String ())
222
222
223
- // create a symlink that loops on himself
223
+ // Create a symlink that loops on himself
224
+ //
225
+ // /tmp/cli2843369229/Arduino/CompileIntegrationTestSymlinkSelfLoop
226
+ // ├── CompileIntegrationTestSymlinkSelfLoop.ino
227
+ // └── loop -> /tmp/cli2843369229/Arduino/CompileIntegrationTestSymlinkSelfLoop/loop
228
+ //
229
+ // in this case the link is "broken", and it will be ignored by the compiler
224
230
loopFilePath := sketchPath .Join ("loop" )
225
231
err = os .Symlink (loopFilePath .String (), loopFilePath .String ())
226
232
require .NoError (t , err )
227
233
228
- // Build sketch for arduino:avr:uno
234
+ _ , _ , err = cli .Run ("compile" , "-b" , fqbn , sketchPath .String ())
235
+ require .NoError (t , err )
236
+
237
+ // Add a symlink that loops on himself named as a .ino file
238
+ //
239
+ // /tmp/cli2843369229/Arduino/CompileIntegrationTestSymlinkSelfLoop
240
+ // ├── CompileIntegrationTestSymlinkSelfLoop.ino
241
+ // ├── loop -> /tmp/cli2843369229/Arduino/CompileIntegrationTestSymlinkSelfLoop/loop
242
+ // └── loop.ino -> /tmp/cli2843369229/Arduino/CompileIntegrationTestSymlinkSelfLoop/loop.ino
243
+ //
244
+ // in this case the new link is "broken" as before, but being part of the sketch will trigger an error.
245
+ loopInoFilePath := sketchPath .Join ("loop.ino" )
246
+ err = os .Symlink (loopFilePath .String (), loopInoFilePath .String ())
247
+ require .NoError (t , err )
248
+
229
249
_ , stderr , err := cli .Run ("compile" , "-b" , fqbn , sketchPath .String ())
230
250
// The assertion is a bit relaxed in this case because win behaves differently from macOs and linux
231
251
// returning a different error detailed message
232
- require .Contains (t , string (stderr ), "Can't open sketch :" )
252
+ require .Contains (t , string (stderr ), "Error during build :" )
233
253
require .Error (t , err )
234
254
}
235
255
{
0 commit comments