Changeset 24 for trunk/test


Ignore:
Timestamp:
Jan 2, 2006, 9:20:46 AM (18 years ago)
Author:
Peter Johansson
Message:

added trivial test for classes and modified tree to go for the full monty

Location:
trunk/test
Files:
4 added
1 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/Makefile.am

    r9 r24  
    33# $Id$
    44
    5 TESTS = svnstat tree
     5TESTS = directory file stats tree
    66
    77check_PROGRAMS = $(TESTS)
     
    1111INCLUDES = -I@top_srcdir@/lib
    1212
    13 svnstat_SOURCES = svnstat.cc
     13
     14directory_SOURCES = directory.cc
     15file_SOURCES = file.cc
     16stats_SOURCES = stats.cc
    1417tree_SOURCES = tree.cc
  • trunk/test/tree.cc

    r18 r24  
    55#include <string>
    66#include <iostream>
     7#include <ctime>
    78
    89int main(const int argc,const char* argv[])
     
    1011  using namespace theplu::svnstat;
    1112
    12   bool print = (argc>1 && argv[1]==std::string("-p"));
     13  tm q;
     14  std::cout << "== tm struct ==" << std::endl;
     15  std::cout << q.tm_sec << std::endl;
     16  std::cout << q.tm_min << std::endl;
     17  std::cout << q.tm_hour << std::endl;
     18  std::cout << q.tm_mday << std::endl;
     19  std::cout << q.tm_mon << std::endl;
     20  std::cout << q.tm_year << std::endl;
     21  std::cout << q.tm_wday << std::endl;
     22  std::cout << q.tm_yday << std::endl;
     23  char* blaj = asctime(&q);
     24  std::cout << *blaj << std::endl;
     25  time_t tjo = mktime(&q);
     26  std::cout << tjo << std::endl;
     27
     28  //  bool print = (argc>1 && argv[1]==std::string("-p"));
    1329  bool ok = true;
    1430
    15   Directory tree(std::string("."));
     31  Directory tree(std::string("c++_tools"));
    1632
    17   std::cout << "================ Before purge" << std::endl;
    18   if (print)
    19     tree.print();
    20 
    21   std::cout << "================ Purging" << std::endl;
    2233  tree.purge();
    23 
    24   std::cout << "================ After purge" << std::endl;
    25   if (print)
    26     tree.print();
    27 
     34  tree.parse();
     35  tree.print("svnstat_output/");
     36 
    2837  return (ok ? 0 : -1);
    2938}
Note: See TracChangeset for help on using the changeset viewer.