diff options
author | Ayke van Laethem <[email protected]> | 2021-09-22 02:37:10 +0200 |
---|---|---|
committer | Ron Evans <[email protected]> | 2021-10-04 18:22:55 +0200 |
commit | 0a80da46b1eca3cc5da51633b95d5a31b949a59b (patch) | |
tree | 93683585a6409eba62357e33f11ae191865fc1c5 /compileopts/target_test.go | |
parent | 36f1517e8dbd84ab0c8c2ad4fc9ed8fdca09500b (diff) | |
download | tinygo-0a80da46b1eca3cc5da51633b95d5a31b949a59b.tar.gz tinygo-0a80da46b1eca3cc5da51633b95d5a31b949a59b.zip |
main: test other architectures by specifying a different GOARCH
... instead of setting a special -target= value. This is more robust and
makes sure that the test actually tests different arcitectures as they
would be compiled by TinyGo. As an example, the bug of the bugfix in the
previous commit ("arm: use armv7 instead of thumbv7") would have been
caught if this change was applied earlier.
I've decided to put GOOS/GOARCH in compileopts.Options, as it makes
sense to me to treat them the same way as command line parameters.
Diffstat (limited to 'compileopts/target_test.go')
-rw-r--r-- | compileopts/target_test.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compileopts/target_test.go b/compileopts/target_test.go index aa6462383..b065258b3 100644 --- a/compileopts/target_test.go +++ b/compileopts/target_test.go @@ -6,12 +6,12 @@ import ( ) func TestLoadTarget(t *testing.T) { - _, err := LoadTarget("arduino") + _, err := LoadTarget(&Options{Target: "arduino"}) if err != nil { t.Error("LoadTarget test failed:", err) } - _, err = LoadTarget("notexist") + _, err = LoadTarget(&Options{Target: "notexist"}) if err == nil { t.Error("LoadTarget should have failed with non existing target") } |