Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8489583
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T21:52:06+00:00 2026-06-10T21:52:06+00:00

I have a log file containing such output: [mvn] Running com.mypackage.MyTest … [mvn] Tests

  • 0

I have a log file containing such output:

  [mvn] Running com.mypackage.MyTest
   ...
  [mvn] Tests run: 12, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 104.648 sec
  [mvn] Running com.mypackage.MyNotExecutedTest
   ...
  [mvn] Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.525 sec
  [mvn] Running com.mypackage.AnotherNotExecutedTest
   ...
  [mvn] Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.569 sec
  [mvn] Running com.mypackage.FailedTest
   ...
  [mvn] Tests run: 5, Failures: 2, Errors: 0, Skipped: 0, Time elapsed: 22.357 sec
   ...

whereas there can be any arbitrary number of lines where “…” is (e.g. stack trace, some debug output). What I want to achieve is a list of tests which hasn’t been executed:

  com.mypackage.MyNotExecutedTest
  com.mypackage.AnotherNotExecutedTest

So my approach was to grep for pattern “Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed” but then I would somehow need a smart way to find out what Test belongs the grep pattern.
Any good/elegant solutions here? Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T21:52:07+00:00Added an answer on June 10, 2026 at 9:52 pm

    Write an awk script which stores the latest Running line, then prints the stored line if it sees Tests run: 0.

    awk '/\[mvn\] Running /{ t=$3 }
      /\[mvn\] Tests run: 0/ { print t }'  logfile
    

    Edit: I took out the line beginning anchors, in order to correctly cope with indented input.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a log file containing statistics from different servers. I am separating the
I have a huge log file containing log messages prefixed with timestamp. The timestamp
I have a CSV file containing log on data for users and would like
I have a log file containing search queries entered into my site's search engine.
I have a log file containing the following data: Shortest path(2)::RV3280-RV0973C-RV2888C Shortest path(1)::RV3280-RV2502C Shortest
I have a log file that I'm trying to append data to the end
I have a log file that I am reading to a string public static
I have a log file in SqlServer that stores the time an application started,
Lets say we have a log file (preferably a txt file) available in the
I have a transaction log file in CSV format that I want use to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.