Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
TestCTagsRunnerSketchWithClassFunction now tests only the ctags parser
Signed-off-by: Cristian Maglie <[email protected]>
  • Loading branch information
cmaglie committed Nov 16, 2016
commit f44e83504b67e91739baa35a8dab1e9573da639c
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
asdf /home/megabug/Workspace/arduino-builder/src/arduino.cc/builder/test/sketch_class_function/sketch_class_function.ino /^ void asdf() {}$/;" kind:function line:2 class:test signature:() returntype:void
setup /home/megabug/Workspace/arduino-builder/src/arduino.cc/builder/test/sketch_class_function/sketch_class_function.ino /^void setup() {$/;" kind:function line:4 signature:() returntype:void
loop /home/megabug/Workspace/arduino-builder/src/arduino.cc/builder/test/sketch_class_function/sketch_class_function.ino /^void loop() {}$/;" kind:function line:7 signature:() returntype:void
asdf /home/megabug/Workspace/arduino-builder/src/arduino.cc/builder/test/sketch_class_function/sketch_class_function.ino /^void asdf() {}$/;" kind:function line:8 signature:() returntype:void
43 changes: 1 addition & 42 deletions src/arduino.cc/builder/test/ctags_to_prototypes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,9 @@ package test

import (
"io/ioutil"
"os"
"path/filepath"
"testing"

"arduino.cc/builder"
"arduino.cc/builder/constants"
"arduino.cc/builder/ctags"
"arduino.cc/builder/types"
"github.com/stretchr/testify/require"
Expand Down Expand Up @@ -214,45 +211,7 @@ func TestCTagsToPrototypesFunctionPointers(t *testing.T) {
}

func TestCTagsRunnerSketchWithClassFunction(t *testing.T) {
DownloadCoresAndToolsAndLibraries(t)

sketchLocation := Abs(t, filepath.Join("sketch_class_function", "sketch_class_function.ino"))

ctx := &types.Context{
HardwareFolders: []string{filepath.Join("..", "hardware"), "hardware", "downloaded_hardware"},
ToolsFolders: []string{"downloaded_tools"},
BuiltInLibrariesFolders: []string{"downloaded_libraries"},
OtherLibrariesFolders: []string{"libraries"},
SketchLocation: sketchLocation,
FQBN: "arduino:avr:leonardo",
ArduinoAPIVersion: "10600",
Verbose: true,
}

buildPath := SetupBuildPath(t, ctx)
defer os.RemoveAll(buildPath)

commands := []types.Command{

&builder.ContainerSetupHardwareToolsLibsSketchAndProps{},

&builder.ContainerMergeCopySketchFiles{},

&builder.ContainerFindIncludes{},

&builder.PrintUsedLibrariesIfVerbose{},
&builder.WarnAboutArchIncompatibleLibraries{},
&builder.CTagsTargetFileSaver{Source: &ctx.Source, TargetFileName: constants.FILE_CTAGS_TARGET},
&ctags.CTagsRunner{},
&ctags.CTags{},
}

for _, command := range commands {
err := command.Run(ctx)
NoError(t, err)
}

prototypes := ctx.Prototypes
prototypes, _ := producePrototypes(t, "TestCTagsRunnerSketchWithClassFunction.txt")

require.Equal(t, 3, len(prototypes))
require.Equal(t, "void setup();", prototypes[0].Prototype)
Expand Down