mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2025-12-23 15:52:55 +01:00
Create test data helpers
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
#include <openrct2/core/Path.hpp>
|
||||
#include <openrct2/core/String.hpp>
|
||||
#include <openrct2/OpenRCT2.h>
|
||||
#include "TestData.h"
|
||||
|
||||
extern "C"
|
||||
{
|
||||
@@ -55,8 +56,7 @@ protected:
|
||||
|
||||
TEST_F(RideRatings, all)
|
||||
{
|
||||
std::string testdataPath = "testdata";
|
||||
std::string path = Path::Combine(testdataPath, "parks", "sfmm.sc6");
|
||||
std::string path = TestData::GetParkPath("sfmm.sc6");
|
||||
|
||||
gOpenRCT2Headless = true;
|
||||
core_init();
|
||||
|
||||
16
test/tests/TestData.cpp
Normal file
16
test/tests/TestData.cpp
Normal file
@@ -0,0 +1,16 @@
|
||||
#include <openrct2/core/Path.hpp>
|
||||
#include "TestData.h"
|
||||
|
||||
namespace TestData
|
||||
{
|
||||
std::string GetBasePath()
|
||||
{
|
||||
return "testdata";
|
||||
}
|
||||
|
||||
std::string GetParkPath(std::string name)
|
||||
{
|
||||
std::string path = Path::Combine(GetBasePath(), "parks", name);
|
||||
return path;
|
||||
}
|
||||
};
|
||||
9
test/tests/TestData.h
Normal file
9
test/tests/TestData.h
Normal file
@@ -0,0 +1,9 @@
|
||||
#include <string>
|
||||
|
||||
#pragma once
|
||||
|
||||
namespace TestData
|
||||
{
|
||||
std::string GetBasePath();
|
||||
std::string GetParkPath(std::string name);
|
||||
};
|
||||
@@ -48,6 +48,7 @@
|
||||
<!-- Files -->
|
||||
<ItemGroup>
|
||||
<ClInclude Include="AssertHelpers.hpp" />
|
||||
<ClInclude Include="TestData.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="LanguagePackTest.cpp" />
|
||||
@@ -56,6 +57,7 @@
|
||||
<ClCompile Include="RideRatings.cpp" />
|
||||
<ClCompile Include="sawyercoding_test.cpp" />
|
||||
<ClCompile Include="$(GtestDir)\src\gtest-all.cc" />
|
||||
<ClCompile Include="TestData.cpp" />
|
||||
<ClCompile Include="tests.cpp" />
|
||||
<ClCompile Include="StringTest.cpp" />
|
||||
</ItemGroup>
|
||||
|
||||
Reference in New Issue
Block a user