Remove some more boost::filesystem remnants.

This commit is contained in:
Jean-Philip Desjardins 2019-10-17 12:23:26 -04:00
parent 89f184728f
commit b0592d49cf
7 changed files with 23 additions and 26 deletions

View file

@ -7,6 +7,7 @@
#include <sys/inotify.h>
#include <csignal>
#include <unistd.h>
#include "filesystem_def.h"
#define EVENT_SIZE (sizeof(struct inotify_event))
#define EVENT_BUF_LEN (1024 * (EVENT_SIZE + NAME_MAX + 1))

View file

@ -4,14 +4,11 @@
#include <thread>
#include <map>
#include <libevdev.h>
#include <boost/filesystem.hpp>
#include "GamePadUtils.h"
#include "GamePadInputEventListener.h"
#include "Types.h"
namespace fs = boost::filesystem;
class CGamePadDeviceListener
{
public:

View file

@ -45,7 +45,7 @@ void CJUnitTestReportWriter::ReportTestEntry(const std::string& testName, const
m_testCount++;
}
void CJUnitTestReportWriter::Write(const boost::filesystem::path& reportPath)
void CJUnitTestReportWriter::Write(const fs::path& reportPath)
{
m_testSuiteNode->InsertAttribute("tests", string_format("%d", m_testCount).c_str());
auto testOutputFileStream = Framework::CreateOutputStdStream(reportPath.native());

View file

@ -1,6 +1,5 @@
#pragma once
#include <boost/filesystem.hpp>
#include "xml/Node.h"
#include "TestReportWriter.h"
@ -11,7 +10,7 @@ public:
virtual ~CJUnitTestReportWriter();
void ReportTestEntry(const std::string&, const TESTRESULT&) override;
void Write(const boost::filesystem::path&) override;
void Write(const fs::path&) override;
private:
typedef std::unique_ptr<Framework::Xml::CNode> NodePtr;

View file

@ -1,5 +1,5 @@
#include "PS2VM.h"
#include <boost/filesystem.hpp>
#include "filesystem_def.h"
#include "StdStream.h"
#include "StdStreamUtils.h"
#include "iop/IopBios.h"
@ -72,7 +72,7 @@ std::vector<std::string> ReadLines(Framework::CStream& inputStream)
return lines;
}
TESTRESULT GetTestResult(const boost::filesystem::path& testFilePath)
TESTRESULT GetTestResult(const fs::path& testFilePath)
{
TESTRESULT result;
result.succeeded = false;
@ -110,7 +110,7 @@ TESTRESULT GetTestResult(const boost::filesystem::path& testFilePath)
return result;
}
void ExecuteEeTest(const boost::filesystem::path& testFilePath, const std::string& gsHandlerName)
void ExecuteEeTest(const fs::path& testFilePath, const std::string& gsHandlerName)
{
auto resultFilePath = testFilePath;
resultFilePath.replace_extension(".result");
@ -144,7 +144,7 @@ void ExecuteEeTest(const boost::filesystem::path& testFilePath, const std::strin
virtualMachine.Destroy();
}
void ExecuteIopTest(const boost::filesystem::path& testFilePath)
void ExecuteIopTest(const fs::path& testFilePath)
{
//Read in the module data
std::vector<uint8> moduleData;
@ -189,14 +189,14 @@ void ExecuteIopTest(const boost::filesystem::path& testFilePath)
virtualMachine.Destroy();
}
void ScanAndExecuteTests(const boost::filesystem::path& testDirPath, const TestReportWriterPtr& testReportWriter, const std::string& gsHandlerName)
void ScanAndExecuteTests(const fs::path& testDirPath, const TestReportWriterPtr& testReportWriter, const std::string& gsHandlerName)
{
boost::filesystem::directory_iterator endIterator;
for(auto testPathIterator = boost::filesystem::directory_iterator(testDirPath);
fs::directory_iterator endIterator;
for(auto testPathIterator = fs::directory_iterator(testDirPath);
testPathIterator != endIterator; testPathIterator++)
{
auto testPath = testPathIterator->path();
if(boost::filesystem::is_directory(testPath))
if(fs::is_directory(testPath))
{
ScanAndExecuteTests(testPath, testReportWriter, gsHandlerName);
continue;
@ -254,8 +254,8 @@ int main(int argc, const char** argv)
}
TestReportWriterPtr testReportWriter;
boost::filesystem::path autoTestRoot;
boost::filesystem::path reportPath;
fs::path autoTestRoot;
fs::path reportPath;
std::string gsHandlerName = DEFAULT_GS_HANDLER_NAME;
assert(g_validGsHandlersNames.find(gsHandlerName) != std::end(g_validGsHandlersNames));
@ -269,7 +269,7 @@ int main(int argc, const char** argv)
return -1;
}
testReportWriter = std::make_shared<CJUnitTestReportWriter>();
reportPath = boost::filesystem::path(argv[i + 1]);
reportPath = fs::path(argv[i + 1]);
i++;
}
else if(!strcmp(argv[i], "--gshandler"))

View file

@ -1,6 +1,6 @@
#pragma once
#include <boost/filesystem.hpp>
#include "filesystem_def.h"
#include <string>
#include <memory>
@ -26,7 +26,7 @@ public:
}
virtual void ReportTestEntry(const std::string& name, const TESTRESULT&) = 0;
virtual void Write(const boost::filesystem::path& reportPath) = 0;
virtual void Write(const fs::path& reportPath) = 0;
};
typedef std::shared_ptr<CTestReportWriter> TestReportWriterPtr;

View file

@ -18,8 +18,8 @@ void PrepareTestEnvironment(const CGameTestSheet::EnvironmentActionArray& enviro
{
//TODO: There's a bug if there's a slash at the end of the path for the memory card
auto mcPathPreference = Iop::CMcServ::GetMcPathPreference(0);
auto memoryCardPath = boost::filesystem::path("./memorycard");
boost::filesystem::remove_all(memoryCardPath);
auto memoryCardPath = fs::path("./memorycard");
fs::remove_all(memoryCardPath);
CAppConfig::GetInstance().RegisterPreferencePath(mcPathPreference, "");
CAppConfig::GetInstance().SetPreferencePath(mcPathPreference, memoryCardPath);
@ -28,12 +28,12 @@ void PrepareTestEnvironment(const CGameTestSheet::EnvironmentActionArray& enviro
{
if(environmentAction.type == CGameTestSheet::ENVIRONMENT_ACTION_CREATE_DIRECTORY)
{
auto folderToCreate = memoryCardPath / boost::filesystem::path(environmentAction.name);
auto folderToCreate = memoryCardPath / fs::path(environmentAction.name);
Framework::PathUtils::EnsurePathExists(folderToCreate);
}
else if(environmentAction.type == CGameTestSheet::ENVIRONMENT_ACTION_CREATE_FILE)
{
auto fileToCreate = memoryCardPath / boost::filesystem::path(environmentAction.name);
auto fileToCreate = memoryCardPath / fs::path(environmentAction.name);
auto inputStream = Framework::CreateOutputStdStream(fileToCreate.native());
inputStream.Seek(environmentAction.size - 1, Framework::STREAM_SEEK_SET);
inputStream.Write8(0x00);
@ -94,10 +94,10 @@ void ExecuteTest(const CGameTestSheet::TEST& test)
int main(int argc, const char** argv)
{
auto testsPath = boost::filesystem::path("./tests/");
auto testsPath = fs::path("./tests/");
boost::filesystem::directory_iterator endDirectoryIterator;
for(boost::filesystem::directory_iterator directoryIterator(testsPath);
fs::directory_iterator endDirectoryIterator;
for(fs::directory_iterator directoryIterator(testsPath);
directoryIterator != endDirectoryIterator; directoryIterator++)
{
auto testPath = directoryIterator->path();