8000 Porting `legacy` tests to new integration-test infra (part 3...) by cmaglie · Pull Request #2300 · arduino/arduino-cli · GitHub
[go: up one dir, main page]

Skip to content

Porting legacy tests to new integration-test infra (part 3...) #2300

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Sep 8, 2023
Merged
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
Removed unused LoadAndInterpolate function
  • Loading branch information
cmaglie committed Sep 7, 2023
commit 45aa68b0d17f587cc3597fb251375429c6b69f73
21 changes: 0 additions & 21 deletions legacy/builder/test/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,9 @@
package test

import (
"bytes"
"fmt"
"path/filepath"
"testing"
"text/template"

"github.com/arduino/arduino-cli/arduino/builder/cpp"
"github.com/arduino/arduino-cli/arduino/cores"
"github.com/arduino/arduino-cli/arduino/libraries"
"github.com/arduino/arduino-cli/legacy/builder/constants"
Expand All @@ -33,23 +29,6 @@ import (
"github.com/stretchr/testify/require"
)

func LoadAndInterpolate(t *testing.T, filename string, ctx *types.Context) string {
funcsMap := template.FuncMap{
"QuoteCppString": func(p *paths.Path) string { return cpp.QuoteString(p.String()) },
}

tpl, err := template.New(filepath.Base(filename)).Funcs(funcsMap).ParseFiles(filename)
NoError(t, err)

var buf bytes.Buffer
data := make(map[string]interface{})
data["sketch"] = ctx.Sketch
err = tpl.Execute(&buf, data)
NoError(t, err)

return buf.String()
}

func Abs(t *testing.T, rel *paths.Path) *paths.Path {
absPath, err := rel.Abs()
NoError(t, err)
Expand Down
0