Skip to content

Commit f44e835

Browse files
committed
TestCTagsRunnerSketchWithClassFunction now tests only the ctags parser
Signed-off-by: Cristian Maglie <[email protected]>
1 parent f2cf4bd commit f44e835

File tree

2 files changed

+5
-42
lines changed

2 files changed

+5
-42
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
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
2+
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
3+
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
4+
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

src/arduino.cc/builder/test/ctags_to_prototypes_test.go

+1-42
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,9 @@ package test
3131

3232
import (
3333
"io/ioutil"
34-
"os"
3534
"path/filepath"
3635
"testing"
3736

38-
"arduino.cc/builder"
39-
"arduino.cc/builder/constants"
4037
"arduino.cc/builder/ctags"
4138
"arduino.cc/builder/types"
4239
"github.com/stretchr/testify/require"
@@ -214,45 +211,7 @@ func TestCTagsToPrototypesFunctionPointers(t *testing.T) {
214211
}
215212

216213
func TestCTagsRunnerSketchWithClassFunction(t *testing.T) {
217-
DownloadCoresAndToolsAndLibraries(t)
218-
219-
sketchLocation := Abs(t, filepath.Join("sketch_class_function", "sketch_class_function.ino"))
220-
221-
ctx := &types.Context{
222-
HardwareFolders: []string{filepath.Join("..", "hardware"), "hardware", "downloaded_hardware"},
223-
ToolsFolders: []string{"downloaded_tools"},
224-
BuiltInLibrariesFolders: []string{"downloaded_libraries"},
225-
OtherLibrariesFolders: []string{"libraries"},
226-
SketchLocation: sketchLocation,
227-
FQBN: "arduino:avr:leonardo",
228-
ArduinoAPIVersion: "10600",
229-
Verbose: true,
230-
}
231-
232-
buildPath := SetupBuildPath(t, ctx)
233-
defer os.RemoveAll(buildPath)
234-
235-
commands := []types.Command{
236-
237-
&builder.ContainerSetupHardwareToolsLibsSketchAndProps{},
238-
239-
&builder.ContainerMergeCopySketchFiles{},
240-
241-
&builder.ContainerFindIncludes{},
242-
243-
&builder.PrintUsedLibrariesIfVerbose{},
244-
&builder.WarnAboutArchIncompatibleLibraries{},
245-
&builder.CTagsTargetFileSaver{Source: &ctx.Source, TargetFileName: constants.FILE_CTAGS_TARGET},
246-
&ctags.CTagsRunner{},
247-
&ctags.CTags{},
248-
}
249-
250-
for _, command := range commands {
251-
err := command.Run(ctx)
252-
NoError(t, err)
253-
}
254-
255-
prototypes := ctx.Prototypes
214+
prototypes, _ := producePrototypes(t, "TestCTagsRunnerSketchWithClassFunction.txt")
256215

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

0 commit comments

Comments
 (0)