Changeset 2893


Ignore:
Timestamp:
Dec 9, 2012, 8:17:23 AM (9 years ago)
Author:
Peter
Message:

run (also C++) tests in specific test dir so test can create temporary file without colliding with other tests

Location:
trunk/test
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/Makefile.am

    r2891 r2893  
    102102LDADD = yat/libyat.la test/libyattest.la $(YAT_LIBS)
    103103
    104 test_large_file_test_LDADD = test/libyattest.la
    105 
     104#test_large_file_test_LDADD = test/libyattest.la
     105
     106test_libyattest_la_LIBADD = yat/libyat.la
    106107test_libyattest_la_SOURCES = test/Suite.cc
    107108
  • trunk/test/Suite.cc

    r2550 r2893  
    2424
    2525#include "Suite.h"
     26#include "utility.h"
    2627
    2728#include <algorithm>
     
    4344    : known_issues_(0), ok_(true)
    4445  {
     46    std::string test_dir = "test/testSubDir/" + utility::basename(argv[0]);
     47    utility::mkdir_p(test_dir);
     48    chdir(test_dir.c_str());
     49    out() << "running '" << argv[0] << "' in '" << test_dir << "'\n";
    4550    // synchronize cerr and cout, i.e., cout is flushed before
    4651    // writing anything to cerr.
  • trunk/test/commandline.cc

    r2881 r2893  
    6464  suite.err() << "testing commandline" << std::endl;
    6565
    66   // Peter, creation of this directory should perhaps be in a more central place
    67   FileUtil dir("test/testSubDir");
    68   if (!dir.exists())
    69     if (mkdir(dir.path().c_str(), 0755)) {
    70       suite.err() << "mkdir " << dir.path() << " failed\n";
    71       return 1;
    72     }
    73   FileUtil subdir("test/testSubDir/commandline_test.dir");
    74   if (!subdir.exists()) {
    75     if (mkdir(subdir.path().c_str(), 0755)) {
    76       suite.err() << "mkdir " << subdir.path() << " failed\n";
    77       return 1;
    78     }
    79   }
    80   if (subdir.permissions("w")) {
    81     chmod(subdir.path().c_str(), S_IREAD | S_IWRITE | S_IEXEC);
    82   }
    83 
    8466  try {
    8567    suite.add(cmd_help(suite));
     
    628610  }
    629611
    630   FileUtil subdir("test/testSubDir/commandline_test.dir/write-protected");
     612  FileUtil subdir("write-protected");
    631613  if (!subdir.exists()) {
    632614    if (mkdir(subdir.path().c_str(), 0555)) {
Note: See TracChangeset for help on using the changeset viewer.