Changes in / [68e5464:dec60b4]
- Files:
-
- 1 added
- 1 deleted
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
.gitignore
r7d03c8d rde18326 35 35 pm_to_blib 36 36 stamp-h1 37 tester38 37 varstubs.c -
Makefile.am
rc45e1eb r5aa33fd 12 12 zcrypt_SOURCES = zcrypt.c filterproc.c 13 13 14 check_PROGRAMS = tester perl_tester14 check_PROGRAMS = tester.bin 15 15 16 16 barnowl_bin_SOURCES = $(BASE_SRCS) \ … … 21 21 barnowl_bin_LDADD = libfaim/libfaim.a 22 22 23 tester_ SOURCES = $(BASE_SRCS) \23 tester_bin_SOURCES = $(BASE_SRCS) \ 24 24 owl.h owl_perl.h config.h \ 25 25 $(GEN_C) $(GEN_H) \ 26 26 tester.c 27 27 28 tester_LDADD = libfaim/libfaim.a 29 30 perl_tester_SOURCES = $(BASE_SRCS) \ 31 owl.h owl_perl.h config.h \ 32 $(GEN_C) $(GEN_H) \ 33 perl_tester.c 34 35 perl_tester_LDADD = libfaim/libfaim.a 28 tester_bin_LDADD = libfaim/libfaim.a 36 29 37 30 TESTS=runtests.sh -
barnowl
r9a7b4f2 rde18326 5 5 6 6 SRCDIR=`dirname "${0}"` 7 EXE="$ SRCDIR/barnowl.bin"7 EXE="$0.bin" 8 8 9 9 if ! test -x "$EXE"; then -
global.c
r68e5464 r68e5464 1032 1032 g->interrupted = 0; 1033 1033 } 1034 1035 void owl_global_setup_default_filters(owl_global *g) 1036 { 1037 int i; 1038 static const struct { 1039 const char *name; 1040 const char *desc; 1041 } filters[] = { 1042 { "personal", 1043 "private ^true$ and ( not type ^zephyr$ or " 1044 "( class ^message and ( instance ^personal$ or instance ^urgent$ ) ) )" }, 1045 { "trash", 1046 "class ^mail$ or opcode ^ping$ or type ^admin$ or ( not login ^none$ )" }, 1047 { "wordwrap", "not ( type ^admin$ or type ^zephyr$ )" }, 1048 { "ping", "opcode ^ping$" }, 1049 { "auto", "opcode ^auto$" }, 1050 { "login", "not login ^none$" }, 1051 { "reply-lockout", "class ^noc or class ^mail$" }, 1052 { "out", "direction ^out$" }, 1053 { "aim", "type ^aim$" }, 1054 { "zephyr", "type ^zephyr$" }, 1055 { "none", "false" }, 1056 { "all", "true" }, 1057 { NULL, NULL } 1058 }; 1059 1060 owl_function_debugmsg("startup: creating default filters"); 1061 1062 for (i = 0; filters[i].name != NULL; i++) 1063 owl_global_add_filter(g, owl_filter_new_fromstring(filters[i].name, 1064 filters[i].desc)); 1065 } -
owl.c
r3aa0522 r04b16f8 149 149 } 150 150 151 static void owl_setup_default_filters(void)152 {153 int i;154 static const struct {155 const char *name;156 const char *desc;157 } filters[] = {158 { "personal",159 "isprivate ^true$ and ( not type ^zephyr$ or ( class ^message ) )" },160 { "trash",161 "class ^mail$ or opcode ^ping$ or type ^admin$ or ( not login ^none$ )" },162 { "wordwrap", "not ( type ^admin$ or type ^zephyr$ )" },163 { "ping", "opcode ^ping$" },164 { "auto", "opcode ^auto$" },165 { "login", "not login ^none$" },166 { "reply-lockout", "class ^noc or class ^mail$" },167 { "out", "direction ^out$" },168 { "aim", "type ^aim$" },169 { "zephyr", "type ^zephyr$" },170 { "none", "false" },171 { "all", "true" },172 { NULL, NULL }173 };174 175 owl_function_debugmsg("startup: creating default filters");176 177 for (i = 0; filters[i].name != NULL; i++)178 owl_global_add_filter(&g, owl_filter_new_fromstring(filters[i].name,179 filters[i].desc));180 }181 151 182 152 /* … … 563 533 owl_global_complete_setup(&g); 564 534 565 owl_ setup_default_filters();535 owl_global_setup_default_filters(&g); 566 536 567 537 /* set the current view */ -
perlconfig.c
r3aa0522 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
r9f026c1 r5aa33fd 1 1 #!/bin/sh 2 HARNESS_PERL=./perl_tester exec prove t/ 2 SRCDIR=`dirname "${0}"` 3 4 export BARNOWL_DATA_DIR="$SRCDIR/perl/" 5 export BARNOWL_BIN_DIR="$SRCDIR/" 6 7 HARNESS_PERL=./tester exec prove t/ -
t/00-core-tests.t
r1cf3f8d3 r95414bf 1 1 #!/usr/bin/env perl 2 2 use File::Basename; 3 system(dirname($0) . "/../tester" );3 system(dirname($0) . "/../tester", "--builtin"); -
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
r3f6555d r95414bf 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> 4 8 9 #undef instr 10 #include <curses.h> 11 5 12 owl_global g; 6 13 7 14 int numtests; 8 15 16 int owl_regtest(void); 9 17 int owl_util_regtest(void); 10 18 int owl_dict_regtest(void); … … 14 22 int owl_editwin_regtest(void); 15 23 24 extern void owl_perl_xs_init(pTHX); 25 16 26 int main(int argc, char **argv, char **env) 17 27 { 28 FILE *rnull; 29 FILE *wnull; 30 char *perlerr; 31 int status = 0; 32 33 if (argc <= 1) { 34 fprintf(stderr, "Usage: %s --builtin|TEST.t|-le CODE\n", argv[0]); 35 return 1; 36 } 37 18 38 /* initialize a fake ncurses, detached from std{in,out} */ 19 FILE *rnull = fopen("/dev/null", "r");20 FILE *wnull = fopen("/dev/null", "w");39 wnull = fopen("/dev/null", "w"); 40 rnull = fopen("/dev/null", "r"); 21 41 newterm("xterm", wnull, rnull); 22 42 /* initialize global structures */ 23 43 owl_global_init(&g); 24 44 45 perlerr = owl_perlconfig_initperl(NULL, &argc, &argv, &env); 46 if (perlerr) { 47 endwin(); 48 fprintf(stderr, "Internal perl error: %s\n", perlerr); 49 status = 1; 50 goto out; 51 } 52 53 owl_global_complete_setup(&g); 54 owl_global_setup_default_filters(&g); 55 56 owl_view_create(owl_global_get_current_view(&g), "main", 57 owl_global_get_filter(&g, "all"), 58 owl_global_get_style_by_name(&g, "default")); 59 60 owl_function_firstmsg(); 61 62 ENTER; 63 SAVETMPS; 64 65 if (strcmp(argv[1], "--builtin") == 0) { 66 status = owl_regtest(); 67 } else if (strcmp(argv[1], "-le") == 0 && argc > 2) { 68 /* 69 * 'prove' runs its harness perl with '-le CODE' to get some 70 * information out. 71 */ 72 moreswitches("l"); 73 eval_pv(argv[2], true); 74 } else { 75 sv_setpv(get_sv("0", false), argv[1]); 76 sv_setpv(get_sv("main::test_prog", TRUE), argv[1]); 77 78 eval_pv("do $main::test_prog; die($@) if($@)", true); 79 } 80 81 status = 0; 82 83 FREETMPS; 84 LEAVE; 85 86 out: 87 perl_destruct(owl_global_get_perlinterp(&g)); 88 perl_free(owl_global_get_perlinterp(&g)); 89 /* probably not necessary, but tear down the screen */ 90 endwin(); 91 fclose(rnull); 92 fclose(wnull); 93 return status; 94 } 95 96 int owl_regtest(void) { 25 97 numtests = 0; 26 98 int numfailures=0; … … 38 110 } 39 111 printf("1..%d\n", numtests); 40 41 /* probably not necessary, but tear down the screen */42 endwin();43 fclose(rnull);44 fclose(wnull);45 112 46 113 return(numfailures);
Note: See TracChangeset
for help on using the changeset viewer.