diff options
Diffstat (limited to 'src/runtime/proc_test.go')
| -rw-r--r-- | src/runtime/proc_test.go | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/src/runtime/proc_test.go b/src/runtime/proc_test.go index e6947d5849..1715324aa0 100644 --- a/src/runtime/proc_test.go +++ b/src/runtime/proc_test.go @@ -885,23 +885,28 @@ func TestLockOSThreadNesting(t *testing.T) { func TestLockOSThreadExit(t *testing.T) { testLockOSThreadExit(t, "testprog") - - want := "OK\n" - output := runTestProg(t, "testprog", "LockOSThreadAvoidsStatePropagation", "GOMAXPROCS=1") - if output != want { - t.Errorf("want %s, got %s\n", want, output) - } } func testLockOSThreadExit(t *testing.T, prog string) { output := runTestProg(t, prog, "LockOSThreadMain", "GOMAXPROCS=1") want := "OK\n" if output != want { - t.Errorf("want %s, got %s\n", want, output) + t.Errorf("want %q, got %q", want, output) } output = runTestProg(t, prog, "LockOSThreadAlt") if output != want { - t.Errorf("want %s, got %s\n", want, output) + t.Errorf("want %q, got %q", want, output) + } +} + +func TestLockOSThreadAvoidsStatePropagation(t *testing.T) { + want := "OK\n" + skip := "unshare not permitted\n" + output := runTestProg(t, "testprog", "LockOSThreadAvoidsStatePropagation", "GOMAXPROCS=1") + if output == skip { + t.Skip("unshare syscall not permitted on this system") + } else if output != want { + t.Errorf("want %q, got %q", want, output) } } |
