dm: core: Drop header files from dm/test.h

These header file should not be included in other header files. Remove
them and add to each individual file. Add test/test.h to test/ui.h since
that is a reasonable place.

Signed-off-by: Simon Glass <sjg@chromium.org>
diff --git a/include/dm/test.h b/include/dm/test.h
index d39686c..2c92d41 100644
--- a/include/dm/test.h
+++ b/include/dm/test.h
@@ -6,9 +6,6 @@
 #ifndef __DM_TEST_H
 #define __DM_TEST_H
 
-#include <dm.h>
-#include <test/test.h>
-
 /**
  * struct dm_test_cdata - configuration data for test instance
  *
diff --git a/include/test/ut.h b/include/test/ut.h
index 99bbb12..6ab2f88 100644
--- a/include/test/ut.h
+++ b/include/test/ut.h
@@ -11,6 +11,7 @@
 #include <command.h>
 #include <hexdump.h>
 #include <linux/err.h>
+#include <test/test.h>
 
 struct unit_test_state;
 
diff --git a/test/dm/adc.c b/test/dm/adc.c
index da7bd4b..7fa1d48 100644
--- a/test/dm/adc.c
+++ b/test/dm/adc.c
@@ -17,6 +17,7 @@
 #include <power/regulator.h>
 #include <power/sandbox_pmic.h>
 #include <sandbox-adc.h>
+#include <test/test.h>
 #include <test/ut.h>
 
 static int dm_test_adc_bind(struct unit_test_state *uts)
diff --git a/test/dm/audio.c b/test/dm/audio.c
index 77c3a36..4bb86e3 100644
--- a/test/dm/audio.c
+++ b/test/dm/audio.c
@@ -8,6 +8,7 @@
 #include <audio_codec.h>
 #include <dm.h>
 #include <dm/test.h>
+#include <test/test.h>
 #include <test/ut.h>
 #include <asm/test.h>
 
diff --git a/test/dm/axi.c b/test/dm/axi.c
index e1155a5..5b1bbab 100644
--- a/test/dm/axi.c
+++ b/test/dm/axi.c
@@ -8,9 +8,10 @@
 #include <axi.h>
 #include <dm.h>
 #include <log.h>
+#include <asm/axi.h>
 #include <dm/test.h>
+#include <test/test.h>
 #include <test/ut.h>
-#include <asm/axi.h>
 
 /* Test that sandbox AXI works correctly */
 static int dm_test_axi_base(struct unit_test_state *uts)
diff --git a/test/dm/blk.c b/test/dm/blk.c
index 94b2855..80d671e 100644
--- a/test/dm/blk.c
+++ b/test/dm/blk.c
@@ -9,6 +9,7 @@
 #include <usb.h>
 #include <asm/state.h>
 #include <dm/test.h>
+#include <test/test.h>
 #include <test/ut.h>
 
 DECLARE_GLOBAL_DATA_PTR;
diff --git a/test/dm/board.c b/test/dm/board.c
index 5472c65..ff50d6c 100644
--- a/test/dm/board.c
+++ b/test/dm/board.c
@@ -9,6 +9,7 @@
 #include <log.h>
 #include <dm/test.h>
 #include <board.h>
+#include <test/test.h>
 #include <test/ut.h>
 
 #include "../../drivers/board/sandbox.h"
diff --git a/test/dm/bootcount.c b/test/dm/bootcount.c
index be0c278..9fd3751 100644
--- a/test/dm/bootcount.c
+++ b/test/dm/bootcount.c
@@ -9,6 +9,7 @@
 #include <log.h>
 #include <asm/test.h>
 #include <dm/test.h>
+#include <test/test.h>
 #include <test/ut.h>
 
 static int dm_test_bootcount(struct unit_test_state *uts)
diff --git a/test/dm/bus.c b/test/dm/bus.c
index 73eb3ae..0707267 100644
--- a/test/dm/bus.c
+++ b/test/dm/bus.c
@@ -14,6 +14,7 @@
 #include <dm/test.h>
 #include <dm/uclass-internal.h>
 #include <dm/util.h>
+#include <test/test.h>
 #include <test/ut.h>
 
 DECLARE_GLOBAL_DATA_PTR;
diff --git a/test/dm/clk.c b/test/dm/clk.c
index 48fc3dd..7a39760 100644
--- a/test/dm/clk.c
+++ b/test/dm/clk.c
@@ -12,6 +12,7 @@
 #include <dm/test.h>
 #include <dm/device-internal.h>
 #include <linux/err.h>
+#include <test/test.h>
 #include <test/ut.h>
 
 /* Base test of the clk uclass */
diff --git a/test/dm/clk_ccf.c b/test/dm/clk_ccf.c
index ae3a4d8..da2292a 100644
--- a/test/dm/clk_ccf.c
+++ b/test/dm/clk_ccf.c
@@ -11,6 +11,7 @@
 #include <dm/test.h>
 #include <dm/uclass.h>
 #include <linux/err.h>
+#include <test/test.h>
 #include <test/ut.h>
 #include <sandbox-clk.h>
 
diff --git a/test/dm/core.c b/test/dm/core.c
index d20c484..9b73ec3 100644
--- a/test/dm/core.c
+++ b/test/dm/core.c
@@ -16,6 +16,7 @@
 #include <dm/util.h>
 #include <dm/test.h>
 #include <dm/uclass-internal.h>
+#include <test/test.h>
 #include <test/ut.h>
 
 DECLARE_GLOBAL_DATA_PTR;
diff --git a/test/dm/cpu.c b/test/dm/cpu.c
index 46683d8..0a75c91 100644
--- a/test/dm/cpu.c
+++ b/test/dm/cpu.c
@@ -10,6 +10,7 @@
 #include <dm/test.h>
 #include <dm/uclass-internal.h>
 #include <cpu.h>
+#include <test/test.h>
 #include <test/ut.h>
 
 static int dm_test_cpu(struct unit_test_state *uts)
diff --git a/test/dm/dma.c b/test/dm/dma.c
index 317ed4f..1cdc813 100644
--- a/test/dm/dma.c
+++ b/test/dm/dma.c
@@ -11,6 +11,7 @@
 #include <malloc.h>
 #include <dm/test.h>
 #include <dma.h>
+#include <test/test.h>
 #include <test/ut.h>
 
 static int dm_test_dma_m2m(struct unit_test_state *uts)
diff --git a/test/dm/dsi_host.c b/test/dm/dsi_host.c
index 59fcd55..97917a1 100644
--- a/test/dm/dsi_host.c
+++ b/test/dm/dsi_host.c
@@ -10,6 +10,7 @@
 #include <asm/state.h>
 #include <asm/test.h>
 #include <dm/test.h>
+#include <test/test.h>
 #include <test/ut.h>
 
 static int dm_test_dsi_host_phy_init(void *priv_data)
diff --git a/test/dm/eth.c b/test/dm/eth.c
index b58c964..1a3eb18 100644
--- a/test/dm/eth.c
+++ b/test/dm/eth.c
@@ -13,10 +13,11 @@
 #include <log.h>
 #include <malloc.h>
 #include <net.h>
+#include <asm/eth.h>
 #include <dm/test.h>
 #include <dm/device-internal.h>
 #include <dm/uclass-internal.h>
-#include <asm/eth.h>
+#include <test/test.h>
 #include <test/ut.h>
 
 #define DM_TEST_ETH_NUM		4
diff --git a/test/dm/firmware.c b/test/dm/firmware.c
index 60fdcbb..2b4f49a 100644
--- a/test/dm/firmware.c
+++ b/test/dm/firmware.c
@@ -8,6 +8,7 @@
 #include <syscon.h>
 #include <asm/test.h>
 #include <dm/test.h>
+#include <test/test.h>
 #include <test/ut.h>
 
 /* Base test of firmware probe */
diff --git a/test/dm/gpio.c b/test/dm/gpio.c
index b7ee8fc..f3c467e 100644
--- a/test/dm/gpio.c
+++ b/test/dm/gpio.c
@@ -9,10 +9,11 @@
 #include <log.h>
 #include <malloc.h>
 #include <acpi/acpi_device.h>
+#include <asm/gpio.h>
 #include <dm/root.h>
 #include <dm/test.h>
 #include <dm/util.h>
-#include <asm/gpio.h>
+#include <test/test.h>
 #include <test/ut.h>
 
 /* Test that sandbox GPIOs work correctly */
diff --git a/test/dm/hwspinlock.c b/test/dm/hwspinlock.c
index 09ec38b..49c52bc 100644
--- a/test/dm/hwspinlock.c
+++ b/test/dm/hwspinlock.c
@@ -9,6 +9,7 @@
 #include <asm/state.h>
 #include <asm/test.h>
 #include <dm/test.h>
+#include <test/test.h>
 #include <test/ut.h>
 
 /* Test that hwspinlock driver functions are called */
diff --git a/test/dm/i2c.c b/test/dm/i2c.c
index 2025c42..25b2c7c 100644
--- a/test/dm/i2c.c
+++ b/test/dm/i2c.c
@@ -16,6 +16,7 @@
 #include <dm/uclass-internal.h>
 #include <dm/util.h>
 #include <hexdump.h>
+#include <test/test.h>
 #include <test/ut.h>
 
 static const int busnum;
diff --git a/test/dm/i2s.c b/test/dm/i2s.c
index 49ebc35..7a017be 100644
--- a/test/dm/i2s.c
+++ b/test/dm/i2s.c
@@ -7,9 +7,10 @@
 #include <common.h>
 #include <dm.h>
 #include <i2s.h>
+#include <asm/test.h>
 #include <dm/test.h>
+#include <test/test.h>
 #include <test/ut.h>
-#include <asm/test.h>
 
 /* Basic test of the i2s codec uclass */
 static int dm_test_i2s(struct unit_test_state *uts)
diff --git a/test/dm/led.c b/test/dm/led.c
index 00de7b3..3d5ad93 100644
--- a/test/dm/led.c
+++ b/test/dm/led.c
@@ -8,6 +8,7 @@
 #include <led.h>
 #include <asm/gpio.h>
 #include <dm/test.h>
+#include <test/test.h>
 #include <test/ut.h>
 
 /* Base test of the led uclass */
diff --git a/test/dm/mailbox.c b/test/dm/mailbox.c
index e6c521b..e9c8ab1 100644
--- a/test/dm/mailbox.c
+++ b/test/dm/mailbox.c
@@ -8,6 +8,7 @@
 #include <malloc.h>
 #include <dm/test.h>
 #include <asm/mbox.h>
+#include <test/test.h>
 #include <test/ut.h>
 
 static int dm_test_mailbox(struct unit_test_state *uts)
diff --git a/test/dm/mdio.c b/test/dm/mdio.c
index ba1b54f..758bbb2 100644
--- a/test/dm/mdio.c
+++ b/test/dm/mdio.c
@@ -7,10 +7,11 @@
 #include <common.h>
 #include <dm.h>
 #include <log.h>
-#include <dm/test.h>
+#include <miiphy.h>
 #include <misc.h>
+#include <dm/test.h>
+#include <test/test.h>
 #include <test/ut.h>
-#include <miiphy.h>
 
 /* macros copied over from mdio_sandbox.c */
 #define SANDBOX_PHY_ADDR	5
diff --git a/test/dm/mdio_mux.c b/test/dm/mdio_mux.c
index f962e09..0b3f85a 100644
--- a/test/dm/mdio_mux.c
+++ b/test/dm/mdio_mux.c
@@ -6,10 +6,11 @@
 
 #include <common.h>
 #include <dm.h>
-#include <dm/test.h>
+#include <miiphy.h>
 #include <misc.h>
+#include <dm/test.h>
+#include <test/test.h>
 #include <test/ut.h>
-#include <miiphy.h>
 
 /* macros copied over from mdio_sandbox.c */
 #define SANDBOX_PHY_ADDR	5
diff --git a/test/dm/misc.c b/test/dm/misc.c
index 26fd6ac..6410709 100644
--- a/test/dm/misc.c
+++ b/test/dm/misc.c
@@ -8,6 +8,7 @@
 #include <dm.h>
 #include <dm/test.h>
 #include <misc.h>
+#include <test/test.h>
 #include <test/ut.h>
 
 static int dm_test_misc(struct unit_test_state *uts)
diff --git a/test/dm/mmc.c b/test/dm/mmc.c
index 49402b9..8e1fd3f 100644
--- a/test/dm/mmc.c
+++ b/test/dm/mmc.c
@@ -8,6 +8,7 @@
 #include <mmc.h>
 #include <part.h>
 #include <dm/test.h>
+#include <test/test.h>
 #include <test/ut.h>
 
 /*
diff --git a/test/dm/nop.c b/test/dm/nop.c
index 2df29f3..8b3b646 100644
--- a/test/dm/nop.c
+++ b/test/dm/nop.c
@@ -13,6 +13,7 @@
 #include <dm/device.h>
 #include <dm/test.h>
 #include <misc.h>
+#include <test/test.h>
 #include <test/ut.h>
 
 static int noptest_bind(struct udevice *parent)
diff --git a/test/dm/ofnode.c b/test/dm/ofnode.c
index 1114f34..e01acc4 100644
--- a/test/dm/ofnode.c
+++ b/test/dm/ofnode.c
@@ -5,6 +5,7 @@
 #include <log.h>
 #include <dm/of_extra.h>
 #include <dm/test.h>
+#include <test/test.h>
 #include <test/ut.h>
 
 static int dm_test_ofnode_compatible(struct unit_test_state *uts)
diff --git a/test/dm/osd.c b/test/dm/osd.c
index 5739dfa..8784867 100644
--- a/test/dm/osd.c
+++ b/test/dm/osd.c
@@ -7,10 +7,11 @@
 #include <common.h>
 #include <display_options.h>
 #include <dm.h>
-#include <dm/test.h>
-#include <test/ut.h>
 #include <video_osd.h>
 #include <asm/test.h>
+#include <dm/test.h>
+#include <test/test.h>
+#include <test/ut.h>
 
 #include "../../drivers/video/sandbox_osd.h"
 
diff --git a/test/dm/panel.c b/test/dm/panel.c
index 7e4ebd6..410e8f3 100644
--- a/test/dm/panel.c
+++ b/test/dm/panel.c
@@ -14,8 +14,9 @@
 #include <asm/gpio.h>
 #include <asm/test.h>
 #include <dm/test.h>
-#include <test/ut.h>
 #include <power/regulator.h>
+#include <test/test.h>
+#include <test/ut.h>
 
 /* Basic test of the panel uclass */
 static int dm_test_panel(struct unit_test_state *uts)
diff --git a/test/dm/pch.c b/test/dm/pch.c
index 54e33d1..bf17a31 100644
--- a/test/dm/pch.c
+++ b/test/dm/pch.c
@@ -8,6 +8,7 @@
 #include <pch.h>
 #include <asm/test.h>
 #include <dm/test.h>
+#include <test/test.h>
 #include <test/ut.h>
 
 /* Test that sandbox PCH works correctly */
diff --git a/test/dm/pci.c b/test/dm/pci.c
index 39e82b3..a492fc0 100644
--- a/test/dm/pci.c
+++ b/test/dm/pci.c
@@ -8,6 +8,7 @@
 #include <asm/io.h>
 #include <asm/test.h>
 #include <dm/test.h>
+#include <test/test.h>
 #include <test/ut.h>
 
 /* Test that sandbox PCI works correctly */
diff --git a/test/dm/pci_ep.c b/test/dm/pci_ep.c
index 101f861..a29d00e 100644
--- a/test/dm/pci_ep.c
+++ b/test/dm/pci_ep.c
@@ -5,12 +5,13 @@
 
 #include <common.h>
 #include <dm.h>
+#include <hexdump.h>
+#include <pci_ep.h>
 #include <asm/io.h>
 #include <asm/test.h>
 #include <dm/test.h>
+#include <test/test.h>
 #include <test/ut.h>
-#include <hexdump.h>
-#include <pci_ep.h>
 
 /* Test that sandbox PCI EP works correctly */
 static int dm_test_pci_ep_base(struct unit_test_state *uts)
diff --git a/test/dm/phy.c b/test/dm/phy.c
index 99f0119..1a59899 100644
--- a/test/dm/phy.c
+++ b/test/dm/phy.c
@@ -9,6 +9,7 @@
 #include <generic-phy.h>
 #include <log.h>
 #include <dm/test.h>
+#include <test/test.h>
 #include <test/ut.h>
 
 /* Base test of the phy uclass */
diff --git a/test/dm/pmic.c b/test/dm/pmic.c
index b582329..8c2766a 100644
--- a/test/dm/pmic.c
+++ b/test/dm/pmic.c
@@ -10,16 +10,17 @@
 #include <errno.h>
 #include <dm.h>
 #include <fdtdec.h>
+#include <fsl_pmic.h>
 #include <malloc.h>
 #include <dm/device-internal.h>
 #include <dm/root.h>
-#include <dm/util.h>
 #include <dm/test.h>
 #include <dm/uclass-internal.h>
+#include <dm/util.h>
 #include <power/pmic.h>
 #include <power/sandbox_pmic.h>
+#include <test/test.h>
 #include <test/ut.h>
-#include <fsl_pmic.h>
 
 /* Test PMIC get method */
 
diff --git a/test/dm/power-domain.c b/test/dm/power-domain.c
index 8baf5d0..52f88c5 100644
--- a/test/dm/power-domain.c
+++ b/test/dm/power-domain.c
@@ -8,6 +8,7 @@
 #include <malloc.h>
 #include <dm/test.h>
 #include <asm/power-domain.h>
+#include <test/test.h>
 #include <test/ut.h>
 
 /* This must match the specifier for power-domains in the DT node */
diff --git a/test/dm/pwm.c b/test/dm/pwm.c
index b52ee21..8cc911e 100644
--- a/test/dm/pwm.c
+++ b/test/dm/pwm.c
@@ -7,6 +7,7 @@
 #include <dm.h>
 #include <pwm.h>
 #include <dm/test.h>
+#include <test/test.h>
 #include <test/ut.h>
 
 /* Basic test of the pwm uclass */
diff --git a/test/dm/ram.c b/test/dm/ram.c
index 3efdb6b..2456466 100644
--- a/test/dm/ram.c
+++ b/test/dm/ram.c
@@ -7,6 +7,7 @@
 #include <dm.h>
 #include <ram.h>
 #include <dm/test.h>
+#include <test/test.h>
 #include <test/ut.h>
 
 DECLARE_GLOBAL_DATA_PTR;
diff --git a/test/dm/regmap.c b/test/dm/regmap.c
index 809494d..42cc4cb 100644
--- a/test/dm/regmap.c
+++ b/test/dm/regmap.c
@@ -12,6 +12,7 @@
 #include <asm/test.h>
 #include <dm/test.h>
 #include <linux/err.h>
+#include <test/test.h>
 #include <test/ut.h>
 
 /* Base test of register maps */
diff --git a/test/dm/regulator.c b/test/dm/regulator.c
index ca916ee..f412ec2 100644
--- a/test/dm/regulator.c
+++ b/test/dm/regulator.c
@@ -20,6 +20,7 @@
 #include <power/pmic.h>
 #include <power/regulator.h>
 #include <power/sandbox_pmic.h>
+#include <test/test.h>
 #include <test/ut.h>
 
 enum {
diff --git a/test/dm/remoteproc.c b/test/dm/remoteproc.c
index 9511c7d..c6bf2c4 100644
--- a/test/dm/remoteproc.c
+++ b/test/dm/remoteproc.c
@@ -10,7 +10,9 @@
 #include <remoteproc.h>
 #include <asm/io.h>
 #include <dm/test.h>
+#include <test/test.h>
 #include <test/ut.h>
+
 /**
  * dm_test_remoteproc_base() - test the operations after initializations
  * @uts:	unit test state
diff --git a/test/dm/reset.c b/test/dm/reset.c
index 871d640..8232807 100644
--- a/test/dm/reset.c
+++ b/test/dm/reset.c
@@ -10,6 +10,7 @@
 #include <reset.h>
 #include <dm/test.h>
 #include <asm/reset.h>
+#include <test/test.h>
 #include <test/ut.h>
 
 /* This must match the specifier for mbox-names="test" in the DT node */
diff --git a/test/dm/rtc.c b/test/dm/rtc.c
index dd037a6..42a9195 100644
--- a/test/dm/rtc.c
+++ b/test/dm/rtc.c
@@ -14,6 +14,7 @@
 #include <asm/rtc.h>
 #include <asm/test.h>
 #include <dm/test.h>
+#include <test/test.h>
 #include <test/ut.h>
 
 /* Simple RTC sanity check */
diff --git a/test/dm/serial.c b/test/dm/serial.c
index 6237693..a1b122e 100644
--- a/test/dm/serial.c
+++ b/test/dm/serial.c
@@ -8,6 +8,7 @@
 #include <serial.h>
 #include <dm.h>
 #include <dm/test.h>
+#include <test/test.h>
 #include <test/ut.h>
 
 static int dm_test_serial(struct unit_test_state *uts)
diff --git a/test/dm/sf.c b/test/dm/sf.c
index 9e7dead..0f2808f 100644
--- a/test/dm/sf.c
+++ b/test/dm/sf.c
@@ -15,6 +15,7 @@
 #include <asm/test.h>
 #include <dm/test.h>
 #include <dm/util.h>
+#include <test/test.h>
 #include <test/ut.h>
 
 /* Simple test of sandbox SPI flash */
diff --git a/test/dm/smem.c b/test/dm/smem.c
index 4099a5f..21dd96e 100644
--- a/test/dm/smem.c
+++ b/test/dm/smem.c
@@ -7,6 +7,7 @@
 #include <dm.h>
 #include <smem.h>
 #include <dm/test.h>
+#include <test/test.h>
 #include <test/ut.h>
 
 /* Basic test of the smem uclass */
diff --git a/test/dm/sound.c b/test/dm/sound.c
index aa5368f..9cb9961 100644
--- a/test/dm/sound.c
+++ b/test/dm/sound.c
@@ -9,6 +9,7 @@
 #include <sound.h>
 #include <dm/test.h>
 #include <test/ut.h>
+#include <test/test.h>
 #include <asm/test.h>
 
 /* Basic test of the sound codec uclass */
diff --git a/test/dm/spi.c b/test/dm/spi.c
index ff2cddd..10b89e7 100644
--- a/test/dm/spi.c
+++ b/test/dm/spi.c
@@ -13,6 +13,7 @@
 #include <dm/test.h>
 #include <dm/uclass-internal.h>
 #include <dm/util.h>
+#include <test/test.h>
 #include <test/ut.h>
 
 /* Test that we can find buses and chip-selects */
diff --git a/test/dm/spmi.c b/test/dm/spmi.c
index 668b7e1..4aae1f1 100644
--- a/test/dm/spmi.c
+++ b/test/dm/spmi.c
@@ -14,6 +14,7 @@
 #include <power/pmic.h>
 #include <spmi/spmi.h>
 #include <asm/gpio.h>
+#include <test/test.h>
 #include <test/ut.h>
 
 /* Test if bus childs got probed propperly*/
diff --git a/test/dm/syscon.c b/test/dm/syscon.c
index 06a1c69..b2d0ade 100644
--- a/test/dm/syscon.c
+++ b/test/dm/syscon.c
@@ -11,6 +11,7 @@
 #include <asm/test.h>
 #include <dm/test.h>
 #include <linux/err.h>
+#include <test/test.h>
 #include <test/ut.h>
 
 /* Base test of system controllers */
diff --git a/test/dm/sysreset.c b/test/dm/sysreset.c
index 5b2358e..e5cd18c 100644
--- a/test/dm/sysreset.c
+++ b/test/dm/sysreset.c
@@ -9,6 +9,7 @@
 #include <asm/state.h>
 #include <asm/test.h>
 #include <dm/test.h>
+#include <test/test.h>
 #include <test/ut.h>
 
 /* Test that we can use particular sysreset devices */
diff --git a/test/dm/tee.c b/test/dm/tee.c
index 632e996..fec9551 100644
--- a/test/dm/tee.c
+++ b/test/dm/tee.c
@@ -10,6 +10,7 @@
 #include <dm/test.h>
 #include <sandboxtee.h>
 #include <tee.h>
+#include <test/test.h>
 #include <test/ut.h>
 #include <tee/optee_ta_avb.h>
 
diff --git a/test/dm/test-driver.c b/test/dm/test-driver.c
index ba85fa3..08bdf01 100644
--- a/test/dm/test-driver.c
+++ b/test/dm/test-driver.c
@@ -11,9 +11,10 @@
 #include <errno.h>
 #include <log.h>
 #include <malloc.h>
+#include <asm/io.h>
 #include <dm/test.h>
+#include <test/test.h>
 #include <test/ut.h>
-#include <asm/io.h>
 
 int dm_testdrv_op_count[DM_TEST_OP_COUNT];
 static struct unit_test_state *uts = &global_dm_test_state;
diff --git a/test/dm/test-fdt.c b/test/dm/test-fdt.c
index 8ef7c7a..c64ac40 100644
--- a/test/dm/test-fdt.c
+++ b/test/dm/test-fdt.c
@@ -18,6 +18,7 @@
 #include <dm/util.h>
 #include <dm/lists.h>
 #include <dm/of_access.h>
+#include <test/test.h>
 #include <test/ut.h>
 
 DECLARE_GLOBAL_DATA_PTR;
diff --git a/test/dm/test-main.c b/test/dm/test-main.c
index 53e5ca3..6d197d0 100644
--- a/test/dm/test-main.c
+++ b/test/dm/test-main.c
@@ -14,6 +14,8 @@
 #include <dm/test.h>
 #include <dm/root.h>
 #include <dm/uclass-internal.h>
+#include <test/test.h>
+#include <test/test.h>
 #include <test/ut.h>
 
 DECLARE_GLOBAL_DATA_PTR;
diff --git a/test/dm/test-uclass.c b/test/dm/test-uclass.c
index b6d629a..760731b 100644
--- a/test/dm/test-uclass.c
+++ b/test/dm/test-uclass.c
@@ -14,6 +14,7 @@
 #include <asm/io.h>
 #include <dm/test.h>
 #include <linux/list.h>
+#include <test/test.h>
 #include <test/ut.h>
 
 static struct unit_test_state *uts = &global_dm_test_state;
diff --git a/test/dm/timer.c b/test/dm/timer.c
index 9367dab..4aa5eea 100644
--- a/test/dm/timer.c
+++ b/test/dm/timer.c
@@ -7,6 +7,7 @@
 #include <dm.h>
 #include <timer.h>
 #include <dm/test.h>
+#include <test/test.h>
 #include <test/ut.h>
 
 /*
diff --git a/test/dm/usb.c b/test/dm/usb.c
index b273a51..6cbb66c 100644
--- a/test/dm/usb.c
+++ b/test/dm/usb.c
@@ -14,6 +14,7 @@
 #include <dm/device-internal.h>
 #include <dm/test.h>
 #include <dm/uclass-internal.h>
+#include <test/test.h>
 #include <test/ut.h>
 
 struct keyboard_test_data {
diff --git a/test/dm/video.c b/test/dm/video.c
index 19f78b6..9523a01 100644
--- a/test/dm/video.c
+++ b/test/dm/video.c
@@ -15,6 +15,7 @@
 #include <video_console.h>
 #include <dm/test.h>
 #include <dm/uclass-internal.h>
+#include <test/test.h>
 #include <test/ut.h>
 
 /*
diff --git a/test/dm/virtio.c b/test/dm/virtio.c
index 4a0c0b2..6361cd5 100644
--- a/test/dm/virtio.c
+++ b/test/dm/virtio.c
@@ -9,9 +9,10 @@
 #include <virtio.h>
 #include <virtio_ring.h>
 #include <dm/device-internal.h>
-#include <dm/uclass-internal.h>
 #include <dm/root.h>
 #include <dm/test.h>
+#include <dm/uclass-internal.h>
+#include <test/test.h>
 #include <test/ut.h>
 
 /* Basic test of the virtio uclass */
diff --git a/test/dm/wdt.c b/test/dm/wdt.c
index 1d31ec5..c704098 100644
--- a/test/dm/wdt.c
+++ b/test/dm/wdt.c
@@ -9,6 +9,7 @@
 #include <asm/state.h>
 #include <asm/test.h>
 #include <dm/test.h>
+#include <test/test.h>
 #include <test/ut.h>
 
 /* Test that watchdog driver functions are called */
diff --git a/test/lib/lmb.c b/test/lib/lmb.c
index a0fe0f6..a344987 100644
--- a/test/lib/lmb.c
+++ b/test/lib/lmb.c
@@ -4,10 +4,12 @@
  */
 
 #include <common.h>
+#include <dm.h>
 #include <lmb.h>
 #include <log.h>
 #include <malloc.h>
 #include <dm/test.h>
+#include <test/test.h>
 #include <test/ut.h>
 
 static int check_lmb(struct unit_test_state *uts, struct lmb *lmb,