]> git.baikalelectronics.ru Git - uboot.git/commitdiff
test: Add a generic function to skip delays
authorSimon Glass <sjg@chromium.org>
Tue, 17 Jan 2023 17:47:36 +0000 (10:47 -0700)
committerTom Rini <trini@konsulko.com>
Mon, 23 Jan 2023 23:11:40 +0000 (18:11 -0500)
At present this feature is sandbox-specific. For running tests on boards,
we need a nop version. Add one.

Signed-off-by: Simon Glass <sjg@chromium.org>
include/test/test.h

index beabe9333dc0ba667b59b66f3de92587c5bef15f..752897cf06fbaf02a7d64e8b597d6dbc37e9d41a 100644 (file)
@@ -170,6 +170,22 @@ static inline int test_load_other_fdt(struct unit_test_state *uts)
        return ret;
 }
 
+/**
+ * Control skipping of time delays
+ *
+ * Some tests have unnecessay time delays (e.g. USB). Allow these to be
+ * skipped to speed up testing
+ *
+ * @param skip_delays  true to skip delays from now on, false to honour delay
+ *                     requests
+ */
+static inline void test_set_skip_delays(bool skip_delays)
+{
+#ifdef CONFIG_SANDBOX
+       state_set_skip_delays(skip_delays);
+#endif
+}
+
 /**
  * test_set_eth_enable() - Enable / disable Ethernet
  *