That was remarkably easy, here is a patch.
From 71ebe05bde570ad498a9d8338815560ff3583ac3 Mon Sep 17 00:00:00 2001
From: Chad Granum <exodist7@gmail.com>
Date: Fri, 6 May 2016 08:43:47 -0700
Subject: [PATCH] Fix tests for Test2
---
t/50test-gpio.t | 6 ++++--
t/51test-spi.t | 6 ++++--
t/52test-i2c.t | 6 ++++--
3 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/t/50test-gpio.t b/t/50test-gpio.t
index 2ba4d1a..854e53f 100644
--- a/t/50test-gpio.t
+++ b/t/50test-gpio.t
@@ -8,11 +8,13 @@ use Test::More;
use Test::Device::Chip::Adapter;
+my $st_indent = $INC{'Test2/API.pm'} ? '' : ' ';
+
my $adapter = Test::Device::Chip::Adapter->new;
my $gpio = $adapter->make_protocol( 'GPIO' )->get;
{
- test_out( ' # Subtest: ->write_gpios' );
+ test_out( "$st_indent# Subtest: ->write_gpios" );
test_out( ' ok 1 - write_gpios' );
test_out( ' 1..1' );
test_out( 'ok 1 - ->write_gpios' );
@@ -26,7 +28,7 @@ my $gpio = $adapter->make_protocol( 'GPIO' )->get;
{
test_out( 'ok 1 - ->read_gpios returns values' );
- test_out( ' # Subtest: ->read_gpios' );
+ test_out( "$st_indent# Subtest: ->read_gpios" );
test_out( ' ok 1 - read_gpios' );
test_out( ' 1..1' );
test_out( 'ok 2 - ->read_gpios' );
diff --git a/t/51test-spi.t b/t/51test-spi.t
index 4728e97..6f4d706 100644
--- a/t/51test-spi.t
+++ b/t/51test-spi.t
@@ -8,13 +8,15 @@ use Test::More;
use Test::Device::Chip::Adapter;
+my $st_indent = $INC{'Test2/API.pm'} ? '' : ' ';
+
my $adapter = Test::Device::Chip::Adapter->new;
my $spi = $adapter->make_protocol( 'SPI' )->get;
ok( defined $spi, 'defined $spi' );
{
- test_out( ' # Subtest: ->write' );
+ test_out( "$st_indent# Subtest: ->write" );
test_out( ' ok 1 - write' );
test_out( ' 1..1' );
test_out( 'ok 1 - ->write' );
@@ -28,7 +30,7 @@ ok( defined $spi, 'defined $spi' );
{
test_out( 'ok 1 - ->readwrite return' );
- test_out( ' # Subtest: ->readwrite' );
+ test_out( "$st_indent# Subtest: ->readwrite" );
test_out( ' ok 1 - readwrite' );
test_out( ' 1..1' );
test_out( 'ok 2 - ->readwrite' );
diff --git a/t/52test-i2c.t b/t/52test-i2c.t
index fad5691..2e2cb48 100644
--- a/t/52test-i2c.t
+++ b/t/52test-i2c.t
@@ -8,13 +8,15 @@ use Test::More;
use Test::Device::Chip::Adapter;
+my $st_indent = $INC{'Test2/API.pm'} ? '' : ' ';
+
my $adapter = Test::Device::Chip::Adapter->new;
my $i2c = $adapter->make_protocol( 'I2C' )->get;
ok( defined $i2c, 'defined $i2c' );
{
- test_out( ' # Subtest: ->write' );
+ test_out( "$st_indent# Subtest: ->write" );
test_out( ' ok 1 - write' );
test_out( ' 1..1' );
test_out( 'ok 1 - ->write' );
@@ -28,7 +30,7 @@ ok( defined $i2c, 'defined $i2c' );
{
test_out( 'ok 1 - ->write_then_read return' );
- test_out( ' # Subtest: ->write_then_read' );
+ test_out( "$st_indent# Subtest: ->write_then_read" );
test_out( ' ok 1 - write_then_read' );
test_out( ' 1..1' );
test_out( 'ok 2 - ->write_then_read' );
--
2.8.2