- Timestamp:
- May 22, 2010, 10:37:25 PM (14 years ago)
- Branches:
- master, release-1.10, release-1.7, release-1.8, release-1.9
- Children:
- 04b16f8
- Parents:
- de18326
- git-author:
- Nelson Elhage <nelhage@mit.edu> (05/19/10 00:39:49)
- git-committer:
- Nelson Elhage <nelhage@mit.edu> (05/22/10 22:37:25)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tester.c
rc2673ab r5aa33fd 1 #define OWL_PERL 2 #define WINDOW FAKE_WINDOW 1 3 #include "owl.h" 4 #undef WINDOW 5 2 6 #include <unistd.h> 3 7 #include <stdlib.h> 8 9 #undef instr 10 #include <curses.h> 4 11 5 12 owl_global g; … … 14 21 int owl_obarray_regtest(void); 15 22 int owl_editwin_regtest(void); 23 24 extern void owl_perl_xs_init(pTHX); 16 25 17 26 int main(int argc, char **argv, char **env) … … 35 44 owl_global_complete_setup(&g); 36 45 37 status = owl_regtest(); 46 if (argc > 1) { 47 char *code; 48 FILE *f; 49 50 if (strcmp(argv[1], "-le") == 0 && argc > 2) { 51 /* 52 * 'prove' runs its harness perl with '-le CODE' to get some 53 * information out. 54 */ 55 moreswitches("l"); 56 code = argv[2]; 57 } else { 58 f = fopen(argv[1], "r"); 59 if (!f) { 60 perror(argv[1]); 61 status = 1; 62 goto out; 63 } 64 code = owl_slurp(f); 65 sv_setpv(get_sv("0", false), argv[1]); 66 } 67 68 ENTER; 69 SAVETMPS; 70 71 eval_pv(code, true); 72 73 status = 0; 74 75 FREETMPS; 76 LEAVE; 77 } else { 78 status = owl_regtest(); 79 } 38 80 39 81 out: 82 perl_destruct(owl_global_get_perlinterp(&g)); 83 perl_free(owl_global_get_perlinterp(&g)); 40 84 /* probably not necessary, but tear down the screen */ 41 85 endwin();
Note: See TracChangeset
for help on using the changeset viewer.