github.com/bananabytelabs/wazero@v0.0.0-20240105073314-54b22a776da8/internal/gojs/testdata/main.go (about)

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