Skip to content

Commit

Permalink
Update README.md and comments
Browse files Browse the repository at this point in the history
  • Loading branch information
elliot-zzh committed Feb 3, 2023
1 parent b77b037 commit ac11f91
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ Also an extension for converting command line arguments to **Lightest** configur
* `--no-output` or `-no` to disable default outputs.
* `--return-zero`, `--return-0` or `-r0` to disable returning 1 when failing.
### To analyze data yourself
### Data analysis
An extension for convenient data analysis and beautiful total report is provided. Just include `lightest/data_analysis_ext.h` to use it. Here is an example of using this extension:
Expand All @@ -243,9 +243,10 @@ TEST(TestPass) { REQ(1, ==, 1); }
TEST(TestFail) { REQ(1, ==, 2); }
REPORT() {
// currently provide these 2 options
REPORT_FAILED_TESTS();
REPORT_PASS_RATE();
// currently provide these 3 options
REPORT_FAILED_TESTS(); // List all failed test, sub tests outputted with tabs
REPORT_PASS_RATE(); // Calculate the passing rate of global tests
REPORT_AVG_TIME(); // Report average time use of global tests
}
```

Expand Down
3 changes: 2 additions & 1 deletion include/lightest/data_analysis_ext.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ void IterFailedTests(const DataSet* data, function<void(const DataSet*)> func) {
} while (0)

// Calculate passing rate and also report the numbers of failed, passed, and
// total tests
// total tests (just include global tests)
#define REPORT_PASS_RATE() \
do { \
unsigned int failedTestCount = 0; \
Expand All @@ -79,6 +79,7 @@ void IterFailedTests(const DataSet* data, function<void(const DataSet*)> func) {
std::cout << std::endl; \
} while (0)

// Calculate & report the average time of global tests
#define REPORT_AVG_TIME() \
do { \
clock_t timeSum = 0; \
Expand Down

0 comments on commit ac11f91

Please sign in to comment.