gopkg.in/hugelgupf/u-root.v2@v2.0.0-20180831055005-3f8fdb0ce09d/integration/io_test.go (about)

     1  // Copyright 2018 the u-root Authors. All rights reserved
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  // +build amd64
     6  
     7  package integration
     8  
     9  import (
    10  	"testing"
    11  )
    12  
    13  // TestIO tests the string "UART TEST" is written to the serial port on 0x3f8.
    14  func TestIO(t *testing.T) {
    15  	// Create the CPIO and start QEMU.
    16  	tmpDir, q := testWithQEMU(t, "io", []string{})
    17  	defer cleanup(t, tmpDir, q)
    18  
    19  	if err := q.Expect("UART TEST"); err != nil {
    20  		t.Fatal(`expected "UART TEST", got error: `, err)
    21  	}
    22  }