Changeset 5aa33fd
- 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)
- Files:
-
- 1 deleted
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
Makefile.am
rde18326 r5aa33fd 11 11 zcrypt_SOURCES = zcrypt.c filterproc.c 12 12 13 check_PROGRAMS = tester.bin perl_tester13 check_PROGRAMS = tester.bin 14 14 15 15 barnowl_bin_SOURCES = $(BASE_SRCS) \ … … 26 26 27 27 tester_bin_LDADD = libfaim/libfaim.a 28 29 perl_tester_SOURCES = $(BASE_SRCS) \30 owl.h owl_perl.h config.h \31 $(GEN_C) $(GEN_H) \32 perl_tester.c33 34 perl_tester_LDADD = libfaim/libfaim.a35 28 36 29 TESTS=runtests.sh -
perlconfig.c
r1b1cd2c r5aa33fd 12 12 /* extern XS(boot_DBI); */ 13 13 14 static void owl_perl_xs_init(pTHX) 14 void owl_perl_xs_init(pTHX) /* noproto */ 15 15 { 16 16 const char *file = __FILE__; … … 363 363 perl_construct(p); 364 364 365 PL_exit_flags |= PERL_EXIT_DESTRUCT_END; 366 365 367 owl_global_set_no_have_config(&g); 366 368 -
runtests.sh
r81601a6 r5aa33fd 5 5 export BARNOWL_BIN_DIR="$SRCDIR/" 6 6 7 HARNESS_PERL=./ perl_tester exec prove t/7 HARNESS_PERL=./tester exec prove t/ -
t/mock.pl
r42ad917 r5aa33fd 1 use File::Basename;2 use lib (dirname($0) . '/../perl/lib');3 4 1 package BarnOwl; 5 2 use strict; 6 3 use warnings; 7 use Carp;8 4 9 sub get_data_dir {"."} 10 sub get_config_dir {"."} 11 sub create_style {} 12 13 sub debug { 5 no warnings 'redefine'; 6 sub debug($) { 14 7 warn "[DEBUG] ", shift, "\n" if $ENV{TEST_VERBOSE}; 15 8 } 16 9 17 sub BarnOwl::Internal::new_command {}18 sub BarnOwl::Internal::new_variable_bool {}19 sub BarnOwl::Internal::new_variable_int {}20 sub BarnOwl::Internal::new_variable_string {}21 sub BarnOwl::Editwin::save_excursion(&) {}22 23 use BarnOwl;24 25 10 1; -
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.