Makefile cppUtest output reformat

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
1
down vote

favorite












I need to reformat the output of a program created with cppUtest during my build from inside a makefile.



I have this target in my Makefile:



.PHONY: runalltests
runalltests: ##@tests Run all tests.
$(ECHO)
@./runAlltests


That executes the 'runalltests' program which outputs this text into terminal. (The dots are important)



......
OK (6 tests, 6 ran, 7 checks, 0 ignored, 0 filtered out, 0 ms)


I know from other answers in the stack overflow site that I need awk, sed or grep (or something I do not know of). But I can not figure it out for a long time now on how to do it so I gave up trying and ask here.



I want to reformat the output into adding 4 spaces before each line.



For example this:



 (Four spaces here)......
(Four spaces here)OK (6 tests, 6 ran, 7 checks, 0 ignored, 0 filtered out, 0 ms)






share|improve this question


























    up vote
    1
    down vote

    favorite












    I need to reformat the output of a program created with cppUtest during my build from inside a makefile.



    I have this target in my Makefile:



    .PHONY: runalltests
    runalltests: ##@tests Run all tests.
    $(ECHO)
    @./runAlltests


    That executes the 'runalltests' program which outputs this text into terminal. (The dots are important)



    ......
    OK (6 tests, 6 ran, 7 checks, 0 ignored, 0 filtered out, 0 ms)


    I know from other answers in the stack overflow site that I need awk, sed or grep (or something I do not know of). But I can not figure it out for a long time now on how to do it so I gave up trying and ask here.



    I want to reformat the output into adding 4 spaces before each line.



    For example this:



     (Four spaces here)......
    (Four spaces here)OK (6 tests, 6 ran, 7 checks, 0 ignored, 0 filtered out, 0 ms)






    share|improve this question
























      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite











      I need to reformat the output of a program created with cppUtest during my build from inside a makefile.



      I have this target in my Makefile:



      .PHONY: runalltests
      runalltests: ##@tests Run all tests.
      $(ECHO)
      @./runAlltests


      That executes the 'runalltests' program which outputs this text into terminal. (The dots are important)



      ......
      OK (6 tests, 6 ran, 7 checks, 0 ignored, 0 filtered out, 0 ms)


      I know from other answers in the stack overflow site that I need awk, sed or grep (or something I do not know of). But I can not figure it out for a long time now on how to do it so I gave up trying and ask here.



      I want to reformat the output into adding 4 spaces before each line.



      For example this:



       (Four spaces here)......
      (Four spaces here)OK (6 tests, 6 ran, 7 checks, 0 ignored, 0 filtered out, 0 ms)






      share|improve this question














      I need to reformat the output of a program created with cppUtest during my build from inside a makefile.



      I have this target in my Makefile:



      .PHONY: runalltests
      runalltests: ##@tests Run all tests.
      $(ECHO)
      @./runAlltests


      That executes the 'runalltests' program which outputs this text into terminal. (The dots are important)



      ......
      OK (6 tests, 6 ran, 7 checks, 0 ignored, 0 filtered out, 0 ms)


      I know from other answers in the stack overflow site that I need awk, sed or grep (or something I do not know of). But I can not figure it out for a long time now on how to do it so I gave up trying and ask here.



      I want to reformat the output into adding 4 spaces before each line.



      For example this:



       (Four spaces here)......
      (Four spaces here)OK (6 tests, 6 ran, 7 checks, 0 ignored, 0 filtered out, 0 ms)








      share|improve this question













      share|improve this question




      share|improve this question








      edited Dec 13 '17 at 16:31

























      asked Dec 13 '17 at 16:19









      Tedi

      84




      84




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          1
          down vote



          accepted










          Simply with sed:



          <runalltests_output> | sed 's/^/ /'





          share|improve this answer




















          • @Tedi, you're welcome
            – RomanPerekhrest
            Dec 13 '17 at 18:14










          Your Answer







          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "106"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: false,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );








           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f410687%2fmakefile-cpputest-output-reformat%23new-answer', 'question_page');

          );

          Post as a guest






























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          1
          down vote



          accepted










          Simply with sed:



          <runalltests_output> | sed 's/^/ /'





          share|improve this answer




















          • @Tedi, you're welcome
            – RomanPerekhrest
            Dec 13 '17 at 18:14














          up vote
          1
          down vote



          accepted










          Simply with sed:



          <runalltests_output> | sed 's/^/ /'





          share|improve this answer




















          • @Tedi, you're welcome
            – RomanPerekhrest
            Dec 13 '17 at 18:14












          up vote
          1
          down vote



          accepted







          up vote
          1
          down vote



          accepted






          Simply with sed:



          <runalltests_output> | sed 's/^/ /'





          share|improve this answer












          Simply with sed:



          <runalltests_output> | sed 's/^/ /'






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Dec 13 '17 at 17:25









          RomanPerekhrest

          22.4k12145




          22.4k12145











          • @Tedi, you're welcome
            – RomanPerekhrest
            Dec 13 '17 at 18:14
















          • @Tedi, you're welcome
            – RomanPerekhrest
            Dec 13 '17 at 18:14















          @Tedi, you're welcome
          – RomanPerekhrest
          Dec 13 '17 at 18:14




          @Tedi, you're welcome
          – RomanPerekhrest
          Dec 13 '17 at 18:14












           

          draft saved


          draft discarded


























           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f410687%2fmakefile-cpputest-output-reformat%23new-answer', 'question_page');

          );

          Post as a guest













































































          Popular posts from this blog

          How to check contact read email or not when send email to Individual?

          Bahrain

          Postfix configuration issue with fips on centos 7; mailgun relay