mirror of https://github.com/tinygo-org/tinygo.git
wasmstm32webassemblymicrocontrollerarmavrspiwasiadafruitarduinocircuitplayground-expressgpioi2cllvmmicrobitnrf51nrf52nrf52840samd21tinygo
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
431 B
20 lines
431 B
5 years ago
|
package main
|
||
|
|
||
|
import "testing"
|
||
|
|
||
|
func TestLoadTarget(t *testing.T) {
|
||
|
_, err := LoadTarget("arduino")
|
||
|
if err != nil {
|
||
|
t.Error("LoadTarget test failed:", err)
|
||
|
}
|
||
|
|
||
|
_, err = LoadTarget("notexist")
|
||
|
if err == nil {
|
||
|
t.Error("LoadTarget should have failed with non existing target")
|
||
|
}
|
||
|
|
||
|
if err.Error() != "expected a full LLVM target or a custom target in -target flag" {
|
||
|
t.Error("LoadTarget failed for wrong reason:", err)
|
||
|
}
|
||
|
}
|