mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-07-31 00:57:48 +00:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 13c0714fda |
+1
-14
@@ -15,7 +15,6 @@ import (
|
|||||||
"runtime"
|
"runtime"
|
||||||
"sort"
|
"sort"
|
||||||
"strings"
|
"strings"
|
||||||
"sync"
|
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@@ -129,18 +128,6 @@ func runPlatTests(target string, matches []string, t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Due to some problems with LLD, we cannot run links in parallel, or in parallel with compiles.
|
|
||||||
// Therefore, we put a lock around builds and run everything else in parallel.
|
|
||||||
var buildLock sync.Mutex
|
|
||||||
|
|
||||||
// runBuild is a thread-safe wrapper around Build.
|
|
||||||
func runBuild(src, out string, opts *compileopts.Options) error {
|
|
||||||
buildLock.Lock()
|
|
||||||
defer buildLock.Unlock()
|
|
||||||
|
|
||||||
return Build(src, out, opts)
|
|
||||||
}
|
|
||||||
|
|
||||||
func runTest(path, target string, t *testing.T, environmentVars []string, additionalArgs []string) {
|
func runTest(path, target string, t *testing.T, environmentVars []string, additionalArgs []string) {
|
||||||
// Get the expected output for this test.
|
// Get the expected output for this test.
|
||||||
txtpath := path[:len(path)-3] + ".txt"
|
txtpath := path[:len(path)-3] + ".txt"
|
||||||
@@ -177,7 +164,7 @@ func runTest(path, target string, t *testing.T, environmentVars []string, additi
|
|||||||
}
|
}
|
||||||
|
|
||||||
binary := filepath.Join(tmpdir, "test")
|
binary := filepath.Join(tmpdir, "test")
|
||||||
err = runBuild("./"+path, binary, config)
|
err = Build("./"+path, binary, config)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
printCompilerError(t.Log, err)
|
printCompilerError(t.Log, err)
|
||||||
t.Fail()
|
t.Fail()
|
||||||
|
|||||||
Reference in New Issue
Block a user