OSDN Git Service

llvmpipe: new -s option to run single test
authorBrian Paul <brianp@vmware.com>
Fri, 4 Jun 2010 23:00:48 +0000 (17:00 -0600)
committerBrian Paul <brianp@vmware.com>
Fri, 4 Jun 2010 23:01:24 +0000 (17:01 -0600)
Put specific test code in the test_single() function and pass -s to
execute that code.

src/gallium/drivers/llvmpipe/lp_test.h
src/gallium/drivers/llvmpipe/lp_test_blend.c
src/gallium/drivers/llvmpipe/lp_test_conv.c
src/gallium/drivers/llvmpipe/lp_test_format.c
src/gallium/drivers/llvmpipe/lp_test_main.c
src/gallium/drivers/llvmpipe/lp_test_printf.c
src/gallium/drivers/llvmpipe/lp_test_sincos.c

index 338a04a..90422e4 100644 (file)
@@ -66,6 +66,8 @@ write_tsv_header(FILE *fp);
 boolean
 test_some(unsigned verbose, FILE *fp, unsigned long n);
 
+boolean
+test_single(unsigned verbose, FILE *fp);
 
 boolean
 test_all(unsigned verbose, FILE *fp);
index 557eb8e..0c95555 100644 (file)
@@ -895,3 +895,11 @@ test_some(unsigned verbose, FILE *fp, unsigned long n)
 
    return success;
 }
+
+
+boolean
+test_single(unsigned verbose, FILE *fp)
+{
+   printf("no test_single()");
+   return TRUE;
+}
index cb0d02a..9b02f43 100644 (file)
@@ -260,10 +260,15 @@ test_one(unsigned verbose,
             success = FALSE;
       }
 
-      if (!success) {
+      if (!success || verbose >= 3) {
          if(verbose < 1)
             dump_conv_types(stderr, src_type, dst_type);
-         fprintf(stderr, "MISMATCH\n");
+         if (success) {
+            fprintf(stderr, "PASS\n");
+         }
+         else {
+            fprintf(stderr, "MISMATCH\n");
+         }
 
          for(j = 0; j < num_srcs; ++j) {
             fprintf(stderr, "  Src%u: ", j);
@@ -429,3 +434,20 @@ test_some(unsigned verbose, FILE *fp, unsigned long n)
 
    return success;
 }
+
+
+boolean
+test_single(unsigned verbose, FILE *fp)
+{
+   /*    float, fixed,  sign,  norm, width, len */
+   struct lp_type f32x4_type =
+      {   TRUE, FALSE,  TRUE,  TRUE,    32,   4 };
+   struct lp_type ub8x4_type =
+      {  FALSE, FALSE, FALSE,  TRUE,     8,  16 };
+
+   boolean success;
+
+   success = test_one(verbose, fp, f32x4_type, ub8x4_type);
+
+   return success;
+}
index 7c0d7d2..8b6dc1c 100644 (file)
@@ -269,3 +269,11 @@ test_some(unsigned verbose, FILE *fp, unsigned long n)
 {
    return test_all(verbose, fp);
 }
+
+
+boolean
+test_single(unsigned verbose, FILE *fp)
+{
+   printf("no test_single()");
+   return TRUE;
+}
index f9dce8b..7bbbc61 100644 (file)
@@ -370,10 +370,13 @@ int main(int argc, char **argv)
    unsigned long n = 1000;
    unsigned i;
    boolean success;
+   boolean single = FALSE;
 
    for(i = 1; i < argc; ++i) {
       if(strcmp(argv[i], "-v") == 0)
          ++verbose;
+      else if(strcmp(argv[i], "-s") == 0)
+         single = TRUE;
       else if(strcmp(argv[i], "-o") == 0)
          fp = fopen(argv[++i], "wt");
       else
@@ -391,7 +394,9 @@ int main(int argc, char **argv)
       write_tsv_header(fp);
    }
       
-   if(n)
+   if (single)
+      success = test_single(verbose, fp);
+   else if (n)
       success = test_some(verbose, fp, n);
    else
       success = test_all(verbose, fp);
index d99ca81..21df83f 100644 (file)
@@ -165,3 +165,11 @@ test_some(unsigned verbose, FILE *fp, unsigned long n)
 {
    return test_all(verbose, fp);
 }
+
+
+boolean
+test_single(unsigned verbose, FILE *fp)
+{
+   printf("no test_single()");
+   return TRUE;
+}
index da16fea..c7a903a 100644 (file)
@@ -198,3 +198,10 @@ test_some(unsigned verbose, FILE *fp, unsigned long n)
 {
    return test_all(verbose, fp);
 }
+
+boolean
+test_single(unsigned verbose, FILE *fp)
+{
+   printf("no test_single()");
+   return TRUE;
+}