aboutsummaryrefslogtreecommitdiffhomepage
path: root/main_test.go
diff options
context:
space:
mode:
authorAyke van Laethem <[email protected]>2020-09-23 17:26:43 +0200
committerRon Evans <[email protected]>2020-10-02 08:54:43 +0200
commit05d2f2c412c351d1262094bf5f75d55eb9b2fbde (patch)
tree207a67ac666ebe9b19a9c4a3b528ce1725e55225 /main_test.go
parent9a12d129ab9628adcff581ef3544529a67cced12 (diff)
downloadtinygo-05d2f2c412c351d1262094bf5f75d55eb9b2fbde.tar.gz
tinygo-05d2f2c412c351d1262094bf5f75d55eb9b2fbde.zip
main: improve support for x86-32 and add tests
To avoid breaking this, make sure we actually test x86-32 (aka i386 aka GOARCH=386) support in CI. Also remove the now-unnecessary binutils-arm-none-eabi package to speed up CI a bit.
Diffstat (limited to 'main_test.go')
-rw-r--r--main_test.go10
1 files changed, 7 insertions, 3 deletions
diff --git a/main_test.go b/main_test.go
index ac01baafa..09c3919e1 100644
--- a/main_test.go
+++ b/main_test.go
@@ -78,6 +78,9 @@ func TestCompiler(t *testing.T) {
}
if runtime.GOOS == "linux" {
+ t.Run("X86Linux", func(t *testing.T) {
+ runPlatTests("i386--linux-gnu", matches, t)
+ })
t.Run("ARMLinux", func(t *testing.T) {
runPlatTests("arm--linux-gnueabihf", matches, t)
})
@@ -189,10 +192,11 @@ func runTest(path, target string, t *testing.T) {
t.Fatal("failed to load target spec:", err)
}
if len(spec.Emulator) == 0 {
- t.Fatal("no emulator available for target:", target)
+ cmd = exec.Command(binary)
+ } else {
+ args := append(spec.Emulator[1:], binary)
+ cmd = exec.Command(spec.Emulator[0], args...)
}
- args := append(spec.Emulator[1:], binary)
- cmd = exec.Command(spec.Emulator[0], args...)
}
stdout := &bytes.Buffer{}
cmd.Stdout = stdout