wa-lang.org/wazero@v1.0.2/internal/gojs/testdata/main.go (about)

     1  package main
     2  
     3  import (
     4  	"fmt"
     5  	"os"
     6  
     7  	"wa-lang.org/wazero/internal/gojs/testdata/argsenv"
     8  	"wa-lang.org/wazero/internal/gojs/testdata/crypto"
     9  	"wa-lang.org/wazero/internal/gojs/testdata/fs"
    10  	"wa-lang.org/wazero/internal/gojs/testdata/gc"
    11  	"wa-lang.org/wazero/internal/gojs/testdata/goroutine"
    12  	"wa-lang.org/wazero/internal/gojs/testdata/http"
    13  	"wa-lang.org/wazero/internal/gojs/testdata/mem"
    14  	"wa-lang.org/wazero/internal/gojs/testdata/stdio"
    15  	"wa-lang.org/wazero/internal/gojs/testdata/syscall"
    16  	"wa-lang.org/wazero/internal/gojs/testdata/time"
    17  )
    18  
    19  // main includes a registry of all tests to reduce compilation time.
    20  func main() {
    21  	switch os.Args[1] {
    22  	case "argsenv":
    23  		argsenv.Main()
    24  	case "crypto":
    25  		crypto.Main()
    26  	case "fs":
    27  		fs.Main()
    28  	case "gc":
    29  		gc.Main()
    30  	case "goroutine":
    31  		goroutine.Main()
    32  	case "http":
    33  		http.Main()
    34  	case "mem":
    35  		mem.Main()
    36  	case "stdio":
    37  		stdio.Main()
    38  	case "syscall":
    39  		syscall.Main()
    40  	case "time":
    41  		time.Main()
    42  	default:
    43  		panic(fmt.Errorf("unsupported arg: %s", os.Args[1]))
    44  	}
    45  }