Skip to content

Add generation statistics report #329

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Aug 2, 2022
Merged

Add generation statistics report #329

merged 8 commits into from
Aug 2, 2022

Conversation

Lana243
Copy link
Collaborator

@Lana243 Lana243 commented Jul 18, 2022

After tests generated generation statistics report could be found in .csv file. The table looks like the following:

File Klee Time (s) Solver Time (s) Resolution Time (s) Regression Tests Generated Error Tests Generated Covered Functions Total functions
lib/main.c 4.14 3.92 0.00 16 4 3 3
lib/structures/structs/simple_structs.c 1.89 0.71 0.00 39 0 9 9
lib/basic_functions.c 7.39 7.24 0.00 9 0 4 4
lib/module/libfunc.c 0.36 0.31 0.00 1 0 1 1
src/simple_calc.c 0.45 0.40 0.00 2 0 2 2
main.c 3.63 3.43 0.00 12 4 1 1
Total: 17.86 (preprocessing +0.66) 16.01 0.00 79 8 20 20

@Lana243 Lana243 requested review from alexey-utkin and ladisgin July 18, 2022 12:33
@Lana243 Lana243 linked an issue Jul 18, 2022 that may be closed by this pull request
@Lana243 Lana243 closed this Jul 18, 2022
@Lana243 Lana243 force-pushed the generation-statistics branch from 6af1295 to 6048615 Compare July 18, 2022 12:54
@Lana243 Lana243 reopened this Jul 18, 2022
@Lana243 Lana243 force-pushed the generation-statistics branch from 4c0e746 to 1c1dffe Compare July 18, 2022 14:19
@Lana243 Lana243 force-pushed the generation-statistics branch from 5fcb836 to 42958c8 Compare July 27, 2022 08:33
@Lana243 Lana243 requested review from alexey-utkin and ladisgin July 27, 2022 08:36
Lana243 and others added 5 commits July 27, 2022 12:03
- `results` entry in json need to be an empy vector, not `null` if no error
- logging was adjusted for CLI mode
- relative path calculation was extended for the case of CLI run inside the project folder
@Lana243 Lana243 force-pushed the generation-statistics branch from 42958c8 to ed0dce6 Compare July 28, 2022 10:05
# Conflicts:
#	server/src/SARIFGenerator.cpp
LOG_S(ERROR) << out;
return {};
} else {
LOG_S(DEBUG) << "klee-stats report:" << '\n' << out;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

split to 2 out same as line 35

#include "CSVReader.h"

namespace StatsUtils {
CSVTable readCSV(std::istream &istream, char sep, bool removeSpaces) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why here is the separator char? But in CSVPrinter it's string.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed type in CSVPrinter to char because in CSVReader we need to parse file by this separator, std::getline allows to provide a char separator, not a string

@Lana243 Lana243 force-pushed the generation-statistics branch from d8a70d1 to cfb6a32 Compare August 1, 2022 09:37
@@ -35,7 +35,7 @@ namespace sarif {
}
++p;
}
if (p == path.end()) {
if (foundStartFragment && p == path.end()) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bad merge, please return to right version
if (p == path.end()) {

@Lana243 Lana243 merged commit 7739d4d into main Aug 2, 2022
@Lana243 Lana243 deleted the generation-statistics branch August 2, 2022 07:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add generation statistics report
3 participants