Making fileutils test handle any checkout dir

This is needed since the checkout dir is not always named 'trunk', e.g. on branches and buildbot checkouts.

BUG=Tests fails if checkout dir is not named trunk.
TEST=test_support_unittests in a couple of different working directory setups.

Review URL: https://webrtc-codereview.appspot.com/915004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@2957 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
kjellander@webrtc.org 2012-10-19 16:07:02 +00:00
parent 0e196e1aa1
commit bf0e5604c4

View File

@ -94,12 +94,10 @@ std::string FileUtilsTest::original_working_dir_ = "";
// directory that is automatically set when the test executable is launched.
// The test is not fully testing the implementation, since we cannot be sure
// of where the executable was launched from.
// The test will fail if the top level directory is not named "trunk".
TEST_F(FileUtilsTest, ProjectRootPathFromUnchangedWorkingDir) {
std::string path = webrtc::test::ProjectRootPath();
std::string expected_end = "trunk";
expected_end = kPathDelimiter + expected_end + kPathDelimiter;
ASSERT_EQ(path.length() - expected_end.length(), path.find(expected_end));
TEST_F(FileUtilsTest, ProjectRootPath) {
std::string project_root = webrtc::test::ProjectRootPath();
// Not very smart, but at least tests something.
ASSERT_GT(project_root.length(), 0u);
}
// Similar to the above test, but for the output dir