Changeset f034ac0


Ignore:
Timestamp:
May 16, 2010, 1:15:25 AM (10 years ago)
Author:
David Benjamin <davidben@mit.edu>
Branches:
master, release-1.7, release-1.8, release-1.9
Children:
c2673ab, 3f6555d
Parents:
3687413
git-author:
David Benjamin <davidben@mit.edu> (05/15/10 16:24:27)
git-committer:
David Benjamin <davidben@mit.edu> (05/16/10 01:15:25)
Message:
Actually initialize owl_global in tester.c

Fixes tests relying on variables being initialized. Better not to keep
duplicating all the owl_global code. We tell ncurses to open a fake
screen a /dev/null and run with it. Explicitly pass "xterm" as the
terminal type to reduce reliance on the running environment. (Passing
NULL defaults to getenv("TERM").)

Signed-off-by: David Benjamin <davidben@mit.edu>
File:
1 edited

Legend:

Unmodified
Added
Removed
  • tester.c

    r4123da1 rf034ac0  
    1616int main(int argc, char **argv, char **env)
    1717{
    18   owl_errqueue_init(owl_global_get_errqueue(&g));
    19   owl_obarray_init(&(g.obarray));
    20   g.context_stack = NULL;
    21   owl_global_push_context(&g, OWL_CTX_STARTUP, NULL, NULL);
     18  /* initialize a fake ncurses, detached from std{in,out} */
     19  FILE *rnull = fopen("/dev/null", "r");
     20  FILE *wnull = fopen("/dev/null", "w");
     21  newterm("xterm", wnull, rnull);
     22  /* initialize global structures */
     23  owl_global_init(&g);
    2224
    2325  numtests = 0;
     
    3739  }
    3840  printf("1..%d\n", numtests);
     41
     42  /* probably not necessary, but tear down the screen */
     43  endwin();
     44  fclose(rnull);
     45  fclose(wnull);
     46
    3947  return(numfailures);
    4048}
Note: See TracChangeset for help on using the changeset viewer.