Ignore:
Timestamp:
Nov 3, 2010, 1:14:01 AM (11 years ago)
Author:
Peter Johansson
Message:

fix test for the case when top_builddir (or one of its ancestors) is a symbolic link

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/0.9-stable/test/option.cc

    r1266 r1271  
    5454{
    5555  suite.out() << "test --root ROOT\n";
    56   test_root(suite, ".", test::abs_builddir()+"/testSubDir/option.test",
    57             "option.test");
    58   test_root(suite, "..", test::abs_builddir()+"/testSubDir","testSubDir");
    59   test_root(suite, "../..", test::abs_builddir(), "test");
     56  test_root(suite, ".", "*/test/testSubDir/option.test", "option.test");
     57  test_root(suite, "..", "*/test/testSubDir","testSubDir");
     58  test_root(suite, "../..", "*/test", "test");
    6059  // test with absolute path
    61   test_root(suite, test::abs_builddir(), test::abs_builddir(), "test");
     60  test_root(suite, test::abs_builddir(), "*/test", "test");
    6261  // test with symbolic link
    6362  if (!node_exist("symlink")) {
     
    6766    }
    6867  }
    69   test_root(suite, "symlink",
    70             test::abs_builddir()+"/testSubDir/option.test", "symlink");
    71   test_root(suite, "symlink/.",
    72             test::abs_builddir()+"/testSubDir/option.test","option.test");
    73   test_root(suite, "symlink/..",
    74             test::abs_builddir()+"/testSubDir", "testSubDir");
     68  test_root(suite, "symlink", "*/test/testSubDir/option.test", "symlink");
     69  test_root(suite, "symlink/.", "*/test/testSubDir/option.test","option.test");
     70  test_root(suite, "symlink/..", "*/test/testSubDir", "testSubDir");
    7571  test_root(suite, test::abs_builddir()+"/testSubDir/option.test/symlink/..",
    76             test::abs_builddir()+"/testSubDir", "testSubDir");
     72            "*/test/testSubDir", "testSubDir");
    7773  test_root(suite, test::abs_builddir()+"/testSubDir/option.test/symlink",
    78             test::abs_builddir()+"/testSubDir/option.test", "symlink");
     74            "*/test/testSubDir/option.test", "symlink");
    7975 
    8076  try {
    81     test_root(suite, "../../Makefile", test::abs_builddir()+"/Makefile",
    82               "Makefile");
     77    test_root(suite, "../../Makefile", "*/Makefile", "Makefile");
    8378    suite.add(false);
    8479    suite.out() << "error: no exception thrown\n --root ../../Makefile\n";
     
    9994  argv.push_back(arg);
    10095  parse(option, argv);
    101   if (option.root() != root) {
     96
     97  if (!theplu::svndigest::fnmatch(root, option.root())) {
    10298    suite.add(false);
     99    suite.out() << "error:\n";
    103100    for (size_t i=0; i<argv.size(); ++i)
    104101      suite.out() << argv[i] << " ";
    105102    suite.out() << "\n";
    106103    suite.out() << "root: `" << option.root() << "'\n";
    107     suite.out() << "expected: `" << root << "'\n";
     104    suite.out() << "expected pattern: `" << root << "'\n\n";
    108105  }
    109106  if (option.root_basename() != root_basename) {
    110107    suite.add(false);
     108    suite.out() << "error\n";
    111109    for (size_t i=0; i<argv.size(); ++i)
    112110      suite.out() << argv[i] << " ";
    113111    suite.out() << "\n";
    114112    suite.out() << "root: `" << option.root_basename() << "'\n";
    115     suite.out() << "expected: `" << root_basename << "'\n";
     113    suite.out() << "expected: `" << root_basename << "'\n\n";
    116114  }
    117115}
Note: See TracChangeset for help on using the changeset viewer.