[BuildSystem] Check command result in MockBuildSystemDelegate
diff --git a/unittests/BuildSystem/BuildSystemTaskTests.cpp b/unittests/BuildSystem/BuildSystemTaskTests.cpp
index 5d9ee9f..55ae57d 100644
--- a/unittests/BuildSystem/BuildSystemTaskTests.cpp
+++ b/unittests/BuildSystem/BuildSystemTaskTests.cpp
@@ -372,7 +372,7 @@
ASSERT_EQ(std::vector<std::string>({
"commandPreparing(C.1)",
"commandStarted(C.1)",
- "commandFinished(C.1)",
+ "commandFinished(C.1: 0)",
}), delegate.getMessages());
}
@@ -409,7 +409,7 @@
"commandStarted(C.1)",
// FIXME: Maybe it's worth creating a virtual FileSystem implementation and checking if `remove` has been called
"cannot remove stale file 'a.out': No such file or directory",
- "commandFinished(C.1)",
+ "commandFinished(C.1: 1)",
}), delegate.getMessages());
}
@@ -457,7 +457,7 @@
ASSERT_EQ(std::vector<std::string>({
"commandPreparing(C.1)",
"commandStarted(C.1)",
- "commandFinished(C.1)",
+ "commandFinished(C.1: 0)",
}), delegate.getMessages());
}
@@ -498,7 +498,7 @@
"Stale file '/bar/a.out' is located outside of the allowed root paths.",
// FIXME: Enable once stale file removal issues are no longer errros.
//"Stale file '/foobar.txt' is located outside of the allowed root paths.",
- "commandFinished(C.1)",
+ "commandFinished(C.1: 1)",
}), delegate.getMessages());
}
@@ -546,7 +546,7 @@
ASSERT_EQ(std::vector<std::string>({
"commandPreparing(C.1)",
"commandStarted(C.1)",
- "commandFinished(C.1)",
+ "commandFinished(C.1: 0)",
}), delegate.getMessages());
}
@@ -583,7 +583,7 @@
"commandPreparing(C.1)",
"commandStarted(C.1)",
"Stale file 'a.out' has a relative path. This is invalid in combination with the root path attribute.",
- "commandFinished(C.1)",
+ "commandFinished(C.1: 1)",
}), delegate.getMessages());
}
@@ -631,7 +631,7 @@
ASSERT_EQ(std::vector<std::string>({
"commandPreparing(C.1)",
"commandStarted(C.1)",
- "commandFinished(C.1)",
+ "commandFinished(C.1: 0)",
}), delegate.getMessages());
}
@@ -669,7 +669,7 @@
"commandStarted(C.1)",
"cannot remove stale file '/foo/': No such file or directory",
"Stale file 'a.out' has a relative path. This is invalid in combination with the root path attribute.",
- "commandFinished(C.1)",
+ "commandFinished(C.1: 1)",
}), delegate.getMessages());
}
diff --git a/unittests/BuildSystem/MockBuildSystemDelegate.h b/unittests/BuildSystem/MockBuildSystemDelegate.h
index bb70114..b9b4f98 100644
--- a/unittests/BuildSystem/MockBuildSystemDelegate.h
+++ b/unittests/BuildSystem/MockBuildSystemDelegate.h
@@ -127,7 +127,7 @@
if (trackAllMessages) {
std::unique_lock<std::mutex> lock(messagesMutex);
messages.push_back(
- ("commandFinished(" + command->getName() + ")").str());
+ ("commandFinished(" + command->getName() + ": " + std::to_string((int)result) + ")").str());
}
}
};