@@ -26,6 +26,42 @@ import (
2626 "gopkg.in/src-d/go-git.v4/plumbing"
2727)
2828
29+ func TestCompileWithFullyPrecompiledLibrary (t * testing.T ) {
30+ env , cli := integrationtest .CreateArduinoCLIWithEnvironment (t )
31+ defer env .CleanUp ()
32+
33+ _ , _ , err := cli .Run ("update" )
34+ require .NoError (t , err )
35+
36+ _ , _ , err = cli .Run ("core" , "install" , "arduino:mbed@1.3.1" )
37+ require .NoError (t , err )
38+ fqbn := "arduino:mbed:nano33ble"
39+
40+ // Create settings with library unsafe install set to true
41+ envVar := cli .GetDefaultEnv ()
42+ envVar ["ARDUINO_LIBRARY_ENABLE_UNSAFE_INSTALL" ] = "true"
43+ _ , _ , err = cli .RunWithCustomEnv (envVar , "config" , "init" , "--dest-dir" , "." )
44+ require .NoError (t , err )
45+
46+ // Install fully precompiled library
47+ // For more information see:
48+ // https://arduino.github.io/arduino-cli/latest/library-specification/#precompiled-binaries
49+ wd , err := paths .Getwd ()
50+ require .NoError (t , err )
51+ _ , _ , err = cli .Run ("lib" , "install" , "--zip-path" , wd .Parent ().Join ("testdata" , "Arduino_TensorFlowLite-2.1.0-ALPHA-precompiled.zip" ).String ())
52+ require .NoError (t , err )
53+ sketchFolder := cli .SketchbookDir ().Join ("libraries" , "Arduino_TensorFlowLite-2.1.0-ALPHA-precompiled" , "examples" , "hello_world" )
54+
55+ // Install example dependency
56+ _ , _ , err = cli .Run ("lib" , "install" , "Arduino_LSM9DS1" )
57+ require .NoError (t , err )
58+
59+ // Compile and verify dependencies detection for fully precompiled library is skipped
60+ stdout , _ , err := cli .Run ("compile" , "-b" , fqbn , sketchFolder .String (), "-v" )
61+ require .NoError (t , err )
62+ require .Contains (t , string (stdout ), "Skipping dependencies detection for precompiled library Arduino_TensorFlowLite" )
63+ }
64+
2965func TestCompileSketchWithPdeExtension (t * testing.T ) {
3066 env , cli := integrationtest .CreateArduinoCLIWithEnvironment (t )
3167 defer env .CleanUp ()
0 commit comments