Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 7 of 7 for captureStdout (0.16 sec)

  1. pkg/log/default_test.go

    			caller:     true,
    			wantExit:   true,
    			stackLevel: DebugLevel,
    		},
    	}
    
    	for i, c := range cases {
    		t.Run(strconv.Itoa(i), func(t *testing.T) {
    			var exitCalled bool
    			lines, err := captureStdout(func() {
    				o := testOptions()
    				o.JSONEncoding = c.json
    
    				if err := Configure(o); err != nil {
    					t.Errorf("Got err '%v', expecting success", err)
    				}
    
    				pt := funcs.Load().(patchTable)
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Tue Mar 26 20:38:10 UTC 2024
    - 7.4K bytes
    - Viewed (0)
  2. pkg/log/scope_test.go

    package log
    
    import (
    	"errors"
    	"regexp"
    	"strconv"
    	"testing"
    
    	"go.uber.org/zap/zapcore"
    	"k8s.io/klog/v2"
    )
    
    func runTest(t *testing.T, f func()) []string {
    	lines, err := captureStdout(func() {
    		Configure(DefaultOptions())
    		f()
    		_ = Sync()
    	})
    	if err != nil {
    		t.Fatalf("Got error '%v', expected success", err)
    	}
    	if lines[len(lines)-1] == "" {
    		return lines[:len(lines)-1]
    	}
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Wed Jan 03 17:36:09 UTC 2024
    - 11K bytes
    - Viewed (0)
  3. pkg/log/config_test.go

    		t.Errorf("Expecting for first line of log to contain HELLO, got %s", lines[0])
    	}
    }
    
    func TestRotateAndStdout(t *testing.T) {
    	dir := t.TempDir()
    
    	file := dir + "/rot.log"
    
    	stdoutLines, _ := captureStdout(func() {
    		o := DefaultOptions()
    		o.RotateOutputPath = file
    		if err := Configure(o); err != nil {
    			t.Fatalf("Unable to configure logger: %v", err)
    		}
    
    		defaultScope.Error("HELLO")
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Tue Mar 26 20:38:10 UTC 2024
    - 10.9K bytes
    - Viewed (0)
  4. pkg/log/logr_test.go

    package log
    
    import (
    	"errors"
    	"testing"
    
    	"github.com/go-logr/logr"
    )
    
    func runLogrTestWithScope(t *testing.T, s *Scope, f func(l logr.Logger)) []string {
    	lines, err := captureStdout(func() {
    		Configure(DefaultOptions())
    		l := NewLogrAdapter(s)
    		f(l)
    		_ = Sync()
    	})
    	if err != nil {
    		t.Fatalf("Got error '%v', expected success", err)
    	}
    	if lines[len(lines)-1] == "" {
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Tue May 23 17:08:31 UTC 2023
    - 4.1K bytes
    - Viewed (0)
  5. testing/performance/src/templates/native-dependents-resources/googleTest/libs/googleTest/1.7.0/include/gtest/internal/gtest-port.h

    #if GTEST_HAS_STREAM_REDIRECTION
    
    // Defines the stderr capturer:
    //   CaptureStdout     - starts capturing stdout.
    //   GetCapturedStdout - stops capturing stdout and returns the captured string.
    //   CaptureStderr     - starts capturing stderr.
    //   GetCapturedStderr - stops capturing stderr and returns the captured string.
    //
    GTEST_API_ void CaptureStdout();
    GTEST_API_ std::string GetCapturedStdout();
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Thu Apr 04 07:21:38 UTC 2024
    - 67.2K bytes
    - Viewed (0)
  6. platforms/documentation/docs/src/snippets/native-binaries/google-test/groovy/libs/googleTest/1.7.0/include/gtest/internal/gtest-port.h

    #if GTEST_HAS_STREAM_REDIRECTION
    
    // Defines the stderr capturer:
    //   CaptureStdout     - starts capturing stdout.
    //   GetCapturedStdout - stops capturing stdout and returns the captured string.
    //   CaptureStderr     - starts capturing stderr.
    //   GetCapturedStderr - stops capturing stderr and returns the captured string.
    //
    GTEST_API_ void CaptureStdout();
    GTEST_API_ std::string GetCapturedStdout();
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Mon Nov 27 17:53:42 UTC 2023
    - 67.2K bytes
    - Viewed (0)
  7. container-tests/src/test/java/okhttp3/containers/BasicLoomTest.kt

        // Capture non-deterministic but probable sysout warnings of pinned threads
        // https://docs.oracle.com/en/java/javase/21/core/virtual-threads.html
        System.setOut(PrintStream(capturedOut))
      }
    
      @AfterEach
      fun checkForPinning() {
        assertThat(capturedOut.toString()).isEmpty()
      }
    
      private fun newVirtualThreadPerTaskExecutor(): ExecutorService {
    Registered: Sun Jun 16 04:42:17 UTC 2024
    - Last Modified: Sat Apr 06 11:15:46 UTC 2024
    - 3.7K bytes
    - Viewed (0)
Back to top