pan/bit: Add mode to run unit tests
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Wed, 1 Apr 2020 16:59:53 +0000 (12:59 -0400)
committerMarge Bot <eric+marge@anholt.net>
Sun, 5 Apr 2020 23:26:04 +0000 (23:26 +0000)
Probably the most useful of the bunch going forward.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4458>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4458>

src/panfrost/bifrost/cmdline.c

index f82c613115b988b0e8a7a0580aa06979eb5b54a8..e640a898f769d0745c6ba87cda2dc322a8055d74 100644 (file)
@@ -123,6 +123,16 @@ test_vertex(char **argv)
                         BIT_DEBUG_ALL);
 }
 
+static void
+tests(void)
+{
+        void *memctx = NULL; /* TODO */
+        struct panfrost_device *dev = bit_initialize(memctx);
+        bit_fmod(dev, BIT_DEBUG_FAIL);
+        bit_fma(dev, BIT_DEBUG_FAIL);
+        bit_csel(dev, BIT_DEBUG_FAIL);
+}
+
 static void
 run(const char *filename)
 {
@@ -169,6 +179,8 @@ main(int argc, char **argv)
                 disassemble(argv[2], false);
         else if (strcmp(argv[1], "disasm-verbose") == 0)
                 disassemble(argv[2], true);
+        else if (strcmp(argv[1], "tests") == 0)
+                tests();
         else if (strcmp(argv[1], "test-vertex") == 0)
                 test_vertex(&argv[2]);
         else if (strcmp(argv[1], "run") == 0)