Changeset 5aa33fd


Ignore:
Timestamp:
May 22, 2010, 10:37:25 PM (14 years ago)
Author:
Nelson Elhage <nelhage@mit.edu>
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)
Message:
Merge perl_tester and tester.
Files:
1 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • Makefile.am

    rde18326 r5aa33fd  
    1111zcrypt_SOURCES = zcrypt.c filterproc.c
    1212
    13 check_PROGRAMS = tester.bin perl_tester
     13check_PROGRAMS = tester.bin
    1414
    1515barnowl_bin_SOURCES = $(BASE_SRCS) \
     
    2626
    2727tester_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.c
    33 
    34 perl_tester_LDADD = libfaim/libfaim.a
    3528
    3629TESTS=runtests.sh
  • perlconfig.c

    r1b1cd2c r5aa33fd  
    1212/* extern XS(boot_DBI); */
    1313
    14 static void owl_perl_xs_init(pTHX)
     14void owl_perl_xs_init(pTHX) /* noproto */
    1515{
    1616  const char *file = __FILE__;
     
    363363  perl_construct(p);
    364364
     365  PL_exit_flags |= PERL_EXIT_DESTRUCT_END;
     366
    365367  owl_global_set_no_have_config(&g);
    366368
  • runtests.sh

    r81601a6 r5aa33fd  
    55export BARNOWL_BIN_DIR="$SRCDIR/"
    66
    7 HARNESS_PERL=./perl_tester exec prove t/
     7HARNESS_PERL=./tester exec prove t/
  • t/mock.pl

    r42ad917 r5aa33fd  
    1 use File::Basename;
    2 use lib (dirname($0) . '/../perl/lib');
    3 
    41package BarnOwl;
    52use strict;
    63use warnings;
    7 use Carp;
    84
    9 sub get_data_dir {"."}
    10 sub get_config_dir {"."}
    11 sub create_style {}
    12 
    13 sub debug {
     5no warnings 'redefine';
     6sub debug($) {
    147    warn "[DEBUG] ", shift, "\n" if $ENV{TEST_VERBOSE};
    158}
    169
    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 
    25101;
  • tester.c

    rc2673ab r5aa33fd  
     1#define OWL_PERL
     2#define WINDOW FAKE_WINDOW
    13#include "owl.h"
     4#undef WINDOW
     5
    26#include <unistd.h>
    37#include <stdlib.h>
     8
     9#undef instr
     10#include <curses.h>
    411
    512owl_global g;
     
    1421int owl_obarray_regtest(void);
    1522int owl_editwin_regtest(void);
     23
     24extern void owl_perl_xs_init(pTHX);
    1625
    1726int main(int argc, char **argv, char **env)
     
    3544  owl_global_complete_setup(&g);
    3645
    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  }
    3880
    3981 out:
     82  perl_destruct(owl_global_get_perlinterp(&g));
     83  perl_free(owl_global_get_perlinterp(&g));
    4084  /* probably not necessary, but tear down the screen */
    4185  endwin();
Note: See TracChangeset for help on using the changeset viewer.