Skip to content

Commit 5f0f0aa

Browse files
committed
nit: update main_test.go
Signed-off-by: leongross <[email protected]>
1 parent 673d901 commit 5f0f0aa

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

GNUmakefile

+1
Original file line numberDiff line numberDiff line change
@@ -926,6 +926,7 @@ endif
926926
@cp -rp lib/musl/src/env build/release/tinygo/lib/musl/src
927927
@cp -rp lib/musl/src/errno build/release/tinygo/lib/musl/src
928928
@cp -rp lib/musl/src/exit build/release/tinygo/lib/musl/src
929+
@cp -rp lib/musl/src/fcntl build/release/tinygo/lib/musl/src
929930
@cp -rp lib/musl/src/include build/release/tinygo/lib/musl/src
930931
@cp -rp lib/musl/src/internal build/release/tinygo/lib/musl/src
931932
@cp -rp lib/musl/src/legacy build/release/tinygo/lib/musl/src

main_test.go

+6-10
Original file line numberDiff line numberDiff line change
@@ -341,8 +341,7 @@ func emuCheck(t *testing.T, options compileopts.Options) {
341341
}
342342
if spec.Emulator != "" {
343343
emulatorCommand := strings.SplitN(spec.Emulator, " ", 2)[0]
344-
_, err := exec.LookPath(emulatorCommand)
345-
if err != nil {
344+
if _, err := exec.LookPath(emulatorCommand); err != nil {
346345
if errors.Is(err, exec.ErrNotFound) {
347346
t.Skipf("emulator not installed: %q", emulatorCommand)
348347
}
@@ -672,8 +671,7 @@ func TestWasmExport(t *testing.T) {
672671
builder := r.NewHostModuleBuilder("tester")
673672
builder.NewFunctionBuilder().WithFunc(callOutside).Export("callOutside")
674673
builder.NewFunctionBuilder().WithFunc(callTestMain).Export("callTestMain")
675-
_, err = builder.Instantiate(ctx)
676-
if err != nil {
674+
if _, err = builder.Instantiate(ctx); err != nil {
677675
t.Fatal(err)
678676
}
679677

@@ -730,8 +728,7 @@ func TestWasmFuncOf(t *testing.T) {
730728
cmd := exec.Command("node", "testdata/wasmfunc.js", result.Binary, buildConfig.BuildMode())
731729
cmd.Stdout = output
732730
cmd.Stderr = output
733-
err = cmd.Run()
734-
if err != nil {
731+
if err = cmd.Run(); err != nil {
735732
t.Error("failed to run node:", err)
736733
}
737734
checkOutput(t, "testdata/wasmfunc.txt", output.Bytes())
@@ -771,8 +768,8 @@ func TestWasmExportJS(t *testing.T) {
771768
cmd := exec.Command("node", "testdata/wasmexport.js", result.Binary, buildConfig.BuildMode())
772769
cmd.Stdout = output
773770
cmd.Stderr = output
774-
err = cmd.Run()
775-
if err != nil {
771+
772+
if err = cmd.Run(); err != nil {
776773
t.Error("failed to run node:", err)
777774
}
778775
checkOutput(t, "testdata/wasmexport.txt", output.Bytes())
@@ -1037,8 +1034,7 @@ func TestMain(m *testing.M) {
10371034
switch os.Args[1] {
10381035
case "clang", "ld.lld", "wasm-ld":
10391036
// Invoke a specific tool.
1040-
err := builder.RunTool(os.Args[1], os.Args[2:]...)
1041-
if err != nil {
1037+
if err := builder.RunTool(os.Args[1], os.Args[2:]...); err != nil {
10421038
// The tool should have printed an error message already.
10431039
// Don't print another error message here.
10441040
os.Exit(1)

0 commit comments

Comments
 (0)