@@ -37,6 +37,49 @@ int main(int argc, char** argv)
3737 MSVC:
3838 - src/extra.cpp
3939 - src/debug.cpp
40+ Defines:
41+ Windows:
42+ MSVC:
43+ - _DEBUG
44+ - VERSION=1.0.0
45+ GCC:
46+ - NDEBUG
47+ Setup:
48+ Windows:
49+ MSVC:
50+ - echo 1
51+ - echo 2
52+ Unix:
53+ GCC:
54+ - echo 3
55+ - echo 4
56+ PreBuild:
57+ Windows:
58+ MSVC:
59+ - echo 2
60+ - echo 3
61+ Unix:
62+ GCC:
63+ - echo 4
64+ - echo 5
65+ PostBuild:
66+ Windows:
67+ MSVC:
68+ - echo 3
69+ - echo 4
70+ Unix:
71+ GCC:
72+ - echo 5
73+ - echo 6
74+ Cleanup:
75+ Windows:
76+ MSVC:
77+ - echo 4
78+ - echo 5
79+ Unix:
80+ GCC:
81+ - echo 6
82+ - echo 7
4083 Dependencies:
4184 - Name: MyLib
4285 Platforms:
@@ -55,13 +98,6 @@ int main(int argc, char** argv)
5598 - mylib
5699 SearchDirectories:
57100 - lib/Debug
58- Defines:
59- Windows:
60- MSVC:
61- - _DEBUG
62- - VERSION=1.0.0
63- GCC:
64- - NDEBUG
65101 )" ;
66102
67103 ryml::Tree tree = ryml::parse_in_arena (c4::to_csubstr (yamlStr));
@@ -122,13 +158,6 @@ int main(int argc, char** argv)
122158 ssTEST_OUTPUT_ASSERT (" MSVC files count" , msvcFiles.size () == 2 );
123159 ssTEST_OUTPUT_ASSERT (" MSVC first file" , msvcFiles.at (0 ) == " src/extra.cpp" );
124160
125- // Verify Dependencies
126- ssTEST_OUTPUT_ASSERT (" Dependencies count" , scriptInfo.Dependencies .size (), 1 );
127- ssTEST_OUTPUT_ASSERT (" Dependency name" , scriptInfo.Dependencies .at (0 ).Name == " MyLib" );
128- ssTEST_OUTPUT_ASSERT ( " Dependency type" ,
129- scriptInfo.Dependencies .at (0 ).LibraryType ==
130- runcpp2::Data::DependencyLibraryType::SHARED);
131-
132161 // Verify Defines
133162 ssTEST_OUTPUT_SETUP
134163 (
@@ -139,6 +168,81 @@ int main(int argc, char** argv)
139168 ssTEST_OUTPUT_ASSERT (" MSVC first define" , msvcDefines.at (0 ).Name == " _DEBUG" );
140169 ssTEST_OUTPUT_ASSERT (" MSVC second define name" , msvcDefines.at (1 ).Name == " VERSION" );
141170 ssTEST_OUTPUT_ASSERT (" MSVC second define value" , msvcDefines.at (1 ).Value == " 1.0.0" );
171+
172+ // Verify Setup
173+ ssTEST_OUTPUT_ASSERT ( " Setup commands count MSVC" ,
174+ scriptInfo.Setup .at (" Windows" ).CommandSteps .at (" MSVC" ).size () == 2 );
175+ ssTEST_OUTPUT_ASSERT ( " Setup commands count GCC" ,
176+ scriptInfo.Setup .at (" Unix" ).CommandSteps .at (" GCC" ).size () == 2 );
177+
178+ ssTEST_OUTPUT_SETUP
179+ (
180+ const std::vector<std::string>& msvcSetupCommands =
181+ scriptInfo.Setup .at (" Windows" ).CommandSteps .at (" MSVC" );
182+
183+ const std::vector<std::string>& gccSetupCommands =
184+ scriptInfo.Setup .at (" Unix" ).CommandSteps .at (" GCC" );
185+ );
186+
187+ ssTEST_OUTPUT_ASSERT (" MSVC setup commands count" , msvcSetupCommands.size () == 2 );
188+ ssTEST_OUTPUT_ASSERT (" MSVC setup commands" , msvcSetupCommands.at (0 ) == " echo 1" );
189+
190+ ssTEST_OUTPUT_ASSERT (" GCC setup commands count" , gccSetupCommands.size () == 2 );
191+ ssTEST_OUTPUT_ASSERT (" GCC setup commands" , gccSetupCommands.at (0 ) == " echo 3" );
192+
193+ // Verify PreBuild
194+ ssTEST_OUTPUT_ASSERT ( " PreBuild commands count MSVC" ,
195+ scriptInfo.PreBuild .at (" Windows" ).CommandSteps .at (" MSVC" ).size () == 2 );
196+ ssTEST_OUTPUT_ASSERT ( " PreBuild commands count GCC" ,
197+ scriptInfo.PreBuild .at (" Unix" ).CommandSteps .at (" GCC" ).size () == 2 );
198+
199+ ssTEST_OUTPUT_SETUP
200+ (
201+ const std::vector<std::string>& msvcPreBuildCommands =
202+ scriptInfo.PreBuild .at (" Windows" ).CommandSteps .at (" MSVC" );
203+
204+ const std::vector<std::string>& gccPreBuildCommands =
205+ scriptInfo.PreBuild .at (" Unix" ).CommandSteps .at (" GCC" );
206+ );
207+
208+ ssTEST_OUTPUT_ASSERT (" MSVC prebuild commands count" , msvcPreBuildCommands.size () == 2 );
209+ ssTEST_OUTPUT_ASSERT (" MSVC prebuild commands" , msvcPreBuildCommands.at (0 ) == " echo 2" );
210+
211+ ssTEST_OUTPUT_ASSERT (" GCC prebuild commands count" , gccPreBuildCommands.size () == 2 );
212+ ssTEST_OUTPUT_ASSERT (" GCC prebuild commands" , gccPreBuildCommands.at (1 ) == " echo 5" );
213+
214+ // Verify PostBuild
215+ ssTEST_OUTPUT_ASSERT ( " PostBuild commands count GCC" ,
216+ scriptInfo.PostBuild .at (" Unix" ).CommandSteps .at (" GCC" ).size () == 2 );
217+
218+ ssTEST_OUTPUT_SETUP
219+ (
220+ const std::vector<std::string>& gccPostBuildCommands =
221+ scriptInfo.PostBuild .at (" Unix" ).CommandSteps .at (" GCC" );
222+ );
223+
224+ ssTEST_OUTPUT_ASSERT (" GCC postbuild commands count" , gccPostBuildCommands.size () == 2 );
225+ ssTEST_OUTPUT_ASSERT (" GCC postbuild commands" , gccPostBuildCommands.at (1 ) == " echo 6" );
226+
227+ // Verify Cleanup
228+ ssTEST_OUTPUT_ASSERT ( " Cleanup commands count MSVC" ,
229+ scriptInfo.Cleanup .at (" Windows" ).CommandSteps .at (" MSVC" ).size () == 2 );
230+
231+ ssTEST_OUTPUT_SETUP
232+ (
233+ const std::vector<std::string>& msvcCleanupCommands =
234+ scriptInfo.Cleanup .at (" Windows" ).CommandSteps .at (" MSVC" );
235+ );
236+
237+ ssTEST_OUTPUT_ASSERT (" MSVC cleanup commands count" , msvcCleanupCommands.size () == 2 );
238+ ssTEST_OUTPUT_ASSERT (" MSVC cleanup commands" , msvcCleanupCommands.at (0 ) == " echo 4" );
239+
240+ // Verify Dependencies
241+ ssTEST_OUTPUT_ASSERT (" Dependencies count" , scriptInfo.Dependencies .size (), 1 );
242+ ssTEST_OUTPUT_ASSERT (" Dependency name" , scriptInfo.Dependencies .at (0 ).Name == " MyLib" );
243+ ssTEST_OUTPUT_ASSERT ( " Dependency type" ,
244+ scriptInfo.Dependencies .at (0 ).LibraryType ==
245+ runcpp2::Data::DependencyLibraryType::SHARED);
142246
143247 // Test ToString() and Equals()
144248 ssTEST_OUTPUT_EXECUTION
0 commit comments