Changeset 596 for trunk


Ignore:
Timestamp:
Apr 14, 2008, 11:54:10 PM (13 years ago)
Author:
Peter Johansson
Message:

added testlib to share code between different tests

Location:
trunk/test
Files:
3 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/Makefile.am

    r595 r596  
    3939XFAIL_TESTS = copyright
    4040
     41noinst_HEADERS = Suite.h
    4142
    42 LDADD = $(STATICFLAG) @top_builddir@/lib/libsvndigest.la
     43check_LTLIBRARIES = libsvndigesttest.la
     44
     45
     46LDADD = $(STATICFLAG) @builddir@/libsvndigesttest.la \
     47  @top_builddir@/lib/libsvndigest.la
    4348
    4449AM_CPPFLAGS = -I@top_srcdir@/lib
     50
     51libsvndigesttest_la_SOURCES = Suite.cc
    4552
    4653config_test_SOURCES = config_test.cc
  • trunk/test/copyright.cc

    r595 r596  
    2222*/
    2323
     24#include "Suite.h"
     25
    2426#include "Configuration.h"
    2527#include "File.h"
     
    4345    verbose=true;
    4446
    45   std::string root("toy_project");
     47  std::string root=test::filename("toy_project");
    4648  std::string filename = root + "/README";
    4749
     
    104106  }
    105107  if (verbose) {
    106     std::cout << copyrights.size() << " Copyright lines\n";
     108    std::cout << copyrights.size() << " Copyright lines:\n";
    107109    for (size_t i=0; i<copyrights.size(); ++i)
    108       std::cout << copyrights[i] << "\n";
     110      std::cout << i+1 << ": " << copyrights[i] << "\n";
    109111  }
    110112
  • trunk/test/stats_test.cc

    r556 r596  
    2222*/
    2323
     24#include "Suite.h"
     25
    2426#include "AddStats.h"
    2527#include "BlameStats.h"
     
    3941namespace svndigest{
    4042
    41   /**
    42      \param path is path relaive to srcdir
    43      \return absolute path
    44   */
    45   std::string abs_path(std::string path);
    46  
    4743  bool test_add(void);
    4844  bool test_blame(void);
     
    5652  using namespace theplu::svndigest;
    5753  bool ok=true;
    58   SVN* svn=SVN::instance(abs_path("toy_project"));
     54  SVN* svn=SVN::instance(test::filename("toy_project"));
    5955  if (!svn){
    6056    std::cerr << "error: cannot create SVN instance\n";
     
    7571namespace svndigest{
    7672
    77   std::string abs_path(std::string path)
    78   {
    79     std::string srcdir(getenv("srcdir"));
    80     if (path.empty())
    81       return srcdir;
    82     if (path[path.size()-1]!='/')
    83       srcdir.append("/");
    84     return srcdir + path;
    85   }
    86  
    87  
    8873  bool test_add(void)
    8974  {
     
    10287  {
    10388    bool ok =true;
    104     std::string path = abs_path("toy_project/bin/svnstat.cc");
     89    std::string path = test::filename("toy_project/bin/svnstat.cc");
    10590    ClassicStats cs(path);
    10691    cs.parse(path);
Note: See TracChangeset for help on using the changeset viewer.