mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-07 12:33:42 +00:00
main: refactor build option passing
The list of options passed to build/run/gdb/etc commands was getting unwieldly and hard to add extra options to. Put all common build options in a single build config struct so that these options are more centralized.
This commit is contained in:
+8
-1
@@ -59,8 +59,15 @@ func runTest(path, tmpdir string, target string, t *testing.T) {
|
||||
}
|
||||
|
||||
// Build the test binary.
|
||||
config := &BuildConfig{
|
||||
opt: "z",
|
||||
printIR: false,
|
||||
dumpSSA: false,
|
||||
debug: false,
|
||||
printSizes: "",
|
||||
}
|
||||
binary := filepath.Join(tmpdir, "test")
|
||||
err = Build(path, binary, target, "z", false, false, false, "")
|
||||
err = Build(path, binary, target, config)
|
||||
if err != nil {
|
||||
t.Log("failed to build:", err)
|
||||
t.Fail()
|
||||
|
||||
Reference in New Issue
Block a user