@@ -522,3 +522,43 @@ func TestPrototypesAdderSketchWithDefaultArgs(t *testing.T) {
522
522
require .Equal (t , "#include <Arduino.h>\n #line 1\n " , context [constants .CTX_INCLUDE_SECTION ].(string ))
523
523
require .Equal (t , "void setup();\n void loop();\n #line 1\n " , context [constants .CTX_PROTOTYPE_SECTION ].(string ))
524
524
}
525
+
526
+ func TestPrototypesAdderSketchWithInlineFunction (t * testing.T ) {
527
+ DownloadCoresAndToolsAndLibraries (t )
528
+
529
+ context := make (map [string ]interface {})
530
+
531
+ buildPath := SetupBuildPath (t , context )
532
+ defer os .RemoveAll (buildPath )
533
+
534
+ context [constants .CTX_HARDWARE_FOLDERS ] = []string {filepath .Join (".." , "hardware" ), "hardware" , "downloaded_hardware" }
535
+ context [constants .CTX_TOOLS_FOLDERS ] = []string {"downloaded_tools" }
536
+ context [constants .CTX_FQBN ] = "arduino:avr:leonardo"
537
+ context [constants .CTX_SKETCH_LOCATION ] = filepath .Join ("sketch_with_inline_function" , "sketch.ino" )
538
+ context [constants .CTX_BUILD_PROPERTIES_RUNTIME_IDE_VERSION ] = "10600"
539
+ context [constants .CTX_LIBRARIES_FOLDERS ] = []string {"libraries" , "downloaded_libraries" }
540
+ context [constants .CTX_VERBOSE ] = true
541
+
542
+ commands := []types.Command {
543
+ & builder.SetupHumanLoggerIfMissing {},
544
+
545
+ & builder.ContainerSetupHardwareToolsLibsSketchAndProps {},
546
+
547
+ & builder.ContainerMergeCopySketchFiles {},
548
+
549
+ & builder.ContainerFindIncludes {},
550
+
551
+ & builder.PrintUsedLibrariesIfVerbose {},
552
+ & builder.WarnAboutArchIncompatibleLibraries {},
553
+
554
+ & builder.ContainerAddPrototypes {},
555
+ }
556
+
557
+ for _ , command := range commands {
558
+ err := command .Run (context )
559
+ NoError (t , err )
560
+ }
561
+
562
+ require .Equal (t , "#include <Arduino.h>\n #line 1\n " , context [constants .CTX_INCLUDE_SECTION ].(string ))
563
+ require .Equal (t , "void setup();\n void loop();\n short unsigned int testInt();\n int8_t testInline();\n uint8_t testAttribute();\n #line 1\n " , context [constants .CTX_PROTOTYPE_SECTION ].(string ))
564
+ }
0 commit comments