mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-18 03:24:00 +00:00
Add the environment variable RUN_SMOKETEST_JOBS
This commit is contained in:
@@ -13,6 +13,7 @@ import (
|
|||||||
"os/exec"
|
"os/exec"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"runtime"
|
"runtime"
|
||||||
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/sago35/ochan"
|
"github.com/sago35/ochan"
|
||||||
@@ -20,7 +21,15 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
threads := flag.Int("threads", runtime.NumCPU(), "threads of make smoketest")
|
threads := runtime.NumCPU()
|
||||||
|
if j, ok := os.LookupEnv(`RUN_SMOKETEST_JOBS`); ok {
|
||||||
|
n, err := strconv.ParseInt(j, 0, 0)
|
||||||
|
if err == nil {
|
||||||
|
threads = int(n)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
flag.IntVar(&threads, "threads", threads, "threads of make smoketest")
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
|
|
||||||
if len(os.Args) < 2 {
|
if len(os.Args) < 2 {
|
||||||
@@ -33,7 +42,7 @@ func main() {
|
|||||||
log.Fatalf(err.Error())
|
log.Fatalf(err.Error())
|
||||||
}
|
}
|
||||||
|
|
||||||
err = run(commands, *threads)
|
err = run(commands, threads)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalf(err.Error())
|
log.Fatalf(err.Error())
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user