Changeset a2b3289


Ignore:
Timestamp:
Aug 17, 2009, 9:22:15 PM (12 years ago)
Author:
Nelson Elhage <nelhage@mit.edu>
Branches:
master, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
8bce750
Parents:
ecc958e
Message:
tester: Report the test count at the end, not the beginning.

A static test count is just too much effort to maintain correct.
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • filter.c

    r4542047 ra2b3289  
    311311  owl_message_set_attribute(&m, "foo", "bar");
    312312
    313 #define TEST_FILTER(f, e) numfailed += owl_filter_test_string(f, &m, e)
    314 
     313#define TEST_FILTER(f, e) do {                          \
     314    numtests++;                                         \
     315    numfailed += owl_filter_test_string(f, &m, e);      \
     316      } while(0)
    315317
    316318  TEST_FILTER("true", 1);
  • test.h

    r1cf3f8d3 ra2b3289  
    22#define __OWL_TEST_H__
    33
     4extern int numtests;
     5
    46#define FAIL_UNLESS(desc,pred) do { int __pred = (pred);                \
    5     printf("%s %s", (__pred)?"ok":(numfailed++,"not ok"), desc);     \
     7    numtests++;                                                         \
     8    printf("%s %s", (__pred)?"ok":(numfailed++,"not ok"), desc);        \
    69    if(!(__pred)) printf("\t(%s:%d)", __FILE__, __LINE__); printf("%c", '\n'); } while(0)
    710
  • tester.c

    rd43edd2 ra2b3289  
    55owl_global g;
    66
    7 #define OWL_UTIL_NTESTS  9
    8 #define OWL_DICT_NTESTS  19
    9 #define OWL_OBARRAY_NTESTS  6
    10 #define OWL_VARIABLE_NTESTS  36
    11 #define OWL_FILTER_NTESTS  24
     7int numtests;
    128
    139int main(int argc, char **argv, char **env)
     
    1612  owl_obarray_init(&(g.obarray));
    1713
     14  numtests = 0;
    1815  int numfailures=0;
    19   printf("1..%d\n", OWL_UTIL_NTESTS+OWL_DICT_NTESTS+OWL_VARIABLE_NTESTS
    20          +OWL_FILTER_NTESTS+OWL_OBARRAY_NTESTS);
     16  /*
     17    printf("1..%d\n", OWL_UTIL_NTESTS+OWL_DICT_NTESTS+OWL_VARIABLE_NTESTS
     18    +OWL_FILTER_NTESTS+OWL_OBARRAY_NTESTS);
     19  */
    2120  numfailures += owl_util_regtest();
    2221  numfailures += owl_dict_regtest();
     
    2726      fprintf(stderr, "# *** WARNING: %d failures total\n", numfailures);
    2827  }
     28  printf("1..%d\n", numtests);
    2929  return(numfailures);
    3030}
Note: See TracChangeset for help on using the changeset viewer.