22
33#include " expect_command.h"
44
5+ #include " mock_command_copier.h"
6+
57// NOTE, Make sure all these includes are AFTER the system and header includes
68#include " CppUTest/CommandLineTestRunner.h"
79#include " CppUTest/MemoryLeakDetectorNewMacros.h"
@@ -531,7 +533,9 @@ TEST(RegisterTestGroup, Register_Test) {
531533 target);
532534 reg.Test (stateSuccess, " {executable}" , target);
533535
534- buildcc::m::CommandExpect_Execute (1 , true );
536+ std::vector<std::string> stdout_data;
537+ std::vector<std::string> stderr_data;
538+ buildcc::m::CommandExpect_Execute (1 , true , &stdout_data, &stderr_data);
535539 reg.RunTest ();
536540 }
537541
@@ -601,7 +605,8 @@ TEST(RegisterTestGroup, Register_TestWithOutput) {
601605 {}, {},
602606 buildcc::TestOutput (buildcc::TestOutput::Type::TestPrintOnStderr)));
603607
604- buildcc::m::CommandExpect_Execute (1 , true );
608+ std::vector<std::string> stderr_data;
609+ buildcc::m::CommandExpect_Execute (1 , true , nullptr , &stderr_data);
605610 reg.RunTest ();
606611 }
607612
@@ -618,7 +623,8 @@ TEST(RegisterTestGroup, Register_TestWithOutput) {
618623 {}, {},
619624 buildcc::TestOutput (buildcc::TestOutput::Type::TestPrintOnStdout)));
620625
621- buildcc::m::CommandExpect_Execute (1 , true );
626+ std::vector<std::string> stdout_data;
627+ buildcc::m::CommandExpect_Execute (1 , true , &stdout_data, nullptr );
622628 reg.RunTest ();
623629 }
624630
@@ -635,7 +641,9 @@ TEST(RegisterTestGroup, Register_TestWithOutput) {
635641 buildcc::TestOutput (
636642 buildcc::TestOutput::Type::TestPrintOnStderrAndStdout)));
637643
638- buildcc::m::CommandExpect_Execute (1 , true );
644+ std::vector<std::string> stdout_data;
645+ std::vector<std::string> stderr_data;
646+ buildcc::m::CommandExpect_Execute (1 , true , &stdout_data, &stderr_data);
639647 reg.RunTest ();
640648 }
641649
@@ -676,5 +684,7 @@ TEST(RegisterTestGroup, Register_TestWithOutput) {
676684
677685int main (int ac, char **av) {
678686 MemoryLeakWarningPlugin::turnOffNewDeleteOverloads ();
687+ buildcc::m::VectorStringCopier copier;
688+ mock ().installCopier (TEST_VECTOR_STRING_TYPE, copier);
679689 return CommandLineTestRunner::RunAllTests (ac, av);
680690}
0 commit comments