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:
Ayke van Laethem
2018-10-24 23:53:44 +02:00
parent fcd44c02cd
commit 980dceb192
2 changed files with 50 additions and 24 deletions
+8 -1
View File
@@ -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()