-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBuildTypeTest.cpp
More file actions
60 lines (53 loc) · 1.92 KB
/
Copy pathBuildTypeTest.cpp
File metadata and controls
60 lines (53 loc) · 1.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#include "runcpp2/Data/BuildType.hpp"
#include "runcpp2/Data/BuildTypeHelper.hpp"
#include "runcpp2/runcpp2.hpp"
#include "ssLogger/ssLog.hpp"
DS::Result<void> TestMain()
{
//BuildType Should Generate Correct Output Paths
{
runcpp2::Data::FilesTypesInfo filesTypes;
//Set up StaticLinkFile properties
filesTypes.StaticLinkFile.Prefix["Windows"] = "";
filesTypes.StaticLinkFile.Prefix["Unix"] = "lib";
filesTypes.StaticLinkFile.Extension["Windows"] = ".lib";
filesTypes.StaticLinkFile.Extension["Unix"] = ".a";
runcpp2::Data::Profile profile;
profile.FilesTypes = filesTypes;
profile.Name = "GCC";
ghc::filesystem::path buildDir = "build";
std::string scriptName = "test";
std::vector<ghc::filesystem::path> outTargets;
std::vector<bool> outIsRunnable;
bool result = runcpp2 ::Data
::BuildTypeHelper
::GetPossibleOutputPaths( buildDir,
scriptName,
profile,
runcpp2::Data::BuildType::STATIC,
outTargets,
outIsRunnable);
DS_ASSERT_TRUE(result);
DS_ASSERT_EQ(outTargets.size(), 1);
#ifdef _WIN32
DS_ASSERT_EQ(outTargets.at(0), "build/test.lib");
#else
DS_ASSERT_EQ(outTargets.at(0), "build/libtest.a");
#endif
}
return {};
}
int main(int argc, char** argv)
{
try
{
TestMain().DS_TRY_ACT(ssLOG_LINE(DS_TMP_ERROR.ToString()); return 1);
return 0;
}
catch(std::exception& ex)
{
ssLOG_LINE(ex.what());
return 1;
}
return 1;
}