Skip to content

Commit 0518db1

Browse files
committed
[projmgr] Test OutputDirsAbsolutePath
1 parent 3f8f03a commit 0518db1

File tree

3 files changed

+19
-3
lines changed

3 files changed

+19
-3
lines changed

tools/projmgr/src/ProjMgrCbuildIdx.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,12 @@ ProjMgrCbuildIdx::ProjMgrCbuildIdx(YAML::Node node,
124124
YAML::Node cbuildNode;
125125
const string& filename = context->directories.cprj + "/" + context->name + ".cbuild.yml";
126126
const string& relativeFilename = fs::relative(filename, directory, ec).generic_string();
127+
128+
ProjMgrLogger::Get().Warn("TEST context->name: " + context->name, context->name);
129+
ProjMgrLogger::Get().Warn("TEST context->directories.cprj: " + context->directories.cprj, context->name);
130+
ProjMgrLogger::Get().Warn("TEST filename: " + filename, context->name);
131+
ProjMgrLogger::Get().Warn("TEST relativeFilename: " + relativeFilename, context->name);
132+
127133
SetNodeValue(cbuildNode[YAML_CBUILD], relativeFilename);
128134
if (context->cproject) {
129135
SetNodeValue(cbuildNode[YAML_PROJECT], context->cproject->name);

tools/projmgr/src/ProjMgrWorker.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3537,6 +3537,10 @@ bool ProjMgrWorker::AddFile(const FileNode& src, vector<FileNode>& dst, ContextI
35373537
// Check file existence
35383538
if (!ProjMgrUtils::HasAccessSequence(src.file)) {
35393539
const string file = RteFsUtils::LexicallyNormal(fs::path(context.directories.cprj).append(srcNode.file).generic_string());
3540+
ProjMgrLogger::Get().Warn("TEST src.file: " + src.file, context.name);
3541+
ProjMgrLogger::Get().Warn("TEST context.directories.cprj: " + context.directories.cprj, context.name);
3542+
ProjMgrLogger::Get().Warn("TEST file: " + file, context.name);
3543+
35403544
if (!RteFsUtils::Exists(file)) {
35413545
m_missingFiles[file] = srcNode;
35423546
}

tools/projmgr/test/src/ProjMgrUnitTests.cpp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4119,17 +4119,23 @@ TEST_F(ProjMgrUnitTests, OutputDirsTmpdirAccessSequence) {
41194119
}
41204120

41214121
TEST_F(ProjMgrUnitTests, OutputDirsAbsolutePath) {
4122-
StdStreamRedirect streamRedirect;
4122+
//StdStreamRedirect streamRedirect;
41234123
char* argv[5];
41244124
const string& csolution = testinput_folder + "/TestSolution/outdirs-absolute.csolution.yml";
41254125
argv[1] = (char*)"convert";
41264126
argv[2] = (char*)"--solution";
41274127
argv[3] = (char*)csolution.c_str();
41284128
argv[4] = (char*)"--cbuildgen";
4129+
RteFsUtils::RemoveFile("C:/AC6/main.c");
4130+
RteFsUtils::RemoveFile("C:/GCC/main.c");
41294131
EXPECT_EQ(CrossPlatformUtils::GetHostType() == "win" ? 1 : 0, RunProjMgr(5, argv, m_envp));
41304132

4131-
auto errStr = streamRedirect.GetErrorString();
4132-
EXPECT_TRUE(regex_search(errStr, regex("warning csolution: absolute path .* is not portable, use relative path instead")));
4133+
const auto files = RteFsUtils::GrepFiles("C:/AC6", "*");
4134+
for (const auto& file : files) {
4135+
std::cout << file.generic_string() << std::endl;
4136+
}
4137+
//auto errStr = streamRedirect.GetErrorString();
4138+
//EXPECT_TRUE(regex_search(errStr, regex("warning csolution: absolute path .* is not portable, use relative path instead")));
41334139
}
41344140

41354141
TEST_F(ProjMgrUnitTests, ProjectSetup) {

0 commit comments

Comments
 (0)