Skip to content

Commit

Permalink
Passing all Blahaj-Wizards tests in converted test format
Browse files Browse the repository at this point in the history
  • Loading branch information
JustinMeimar committed May 28, 2024
1 parent 2542f5c commit f685273
Show file tree
Hide file tree
Showing 23 changed files with 505 additions and 1,351 deletions.
13 changes: 13 additions & 0 deletions include/Colors.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#ifndef COLORS_H
#define COLORS_H

#include <string>

namespace Colors {

inline const std::string GREEN = "\033[32m";
inline const std::string RED = "\033[31m";
inline const std::string RESET = "\033[0m";
}

#endif
126 changes: 123 additions & 3 deletions include/analysis/Grader.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,19 @@

#include "config/Config.h"
#include "tests/Util.h"
#include "csv/csv.h"
#include "json.hpp"

#include <ostream>
#include <string>
#include <utility>
#include <map>

using JSON = nlohmann::json;

namespace tester {

// typedef std::map<std::string, std::string>

class Grader {
public:
// No default constructor.
Expand All @@ -19,7 +24,10 @@ class Grader {
// Construct with output file path.
explicit Grader(const Config &cfg);

// void dump(std::ostream &os) const { analysis.dumpSV(os); }
void dump(std::ostream &os) const {
std::string jsonString = results.dump(2);
os << jsonString;
}

private:
// Build the results to produce our sheet.
Expand All @@ -36,9 +44,121 @@ class Grader {
TestModule tests;

// The filtered (must have exe and tests) names of all solutions that will be tested.
std::vector<std::string> names;
std::vector<std::string> names;

// JSON object
JSON results;

};

} // End namespace tester

#endif //TESTER_GRADER_H



/**
The Vision:
[
{
"toolchain": "arm",
"results": {
{
"atacker": "team1",
"defender": "team1",
"testCount": 3,
"testPassed": 3,
"timings (ms)": [10.6, 90.3, 8.5]
},
{
"atacker": "team1",
"defender": "team2",
"testCount": 3,
"testPassed": 1,
"timings (ms)": [10.6, -1, -1]
},
{
"atacker": "team1",
"defender": "team1",
"testCount": 3,
"testPassed": 1,
"timings (ms)": [-1, 4, -1]
},
{
"atacker": "team2",
"defender": "team1",
"testCount": 50,
"testPassed": 48,
"timings (ms)": [10.6, 90.3, 8.5...............]
},
......
}
}, {
"toolchain": "riscv",
"results": {
{
"atacker": "team1",
"defender": "team1",
"testCount": 3,
"testPassed": 3,
"timings (ms)": [10.6, 90.3, 8.5]
},
{
"atacker": "team1",
"defender": "team2",
"testCount": 3,
"testPassed": 1,
"timings (ms)": [10.6, -1, -1]
},
{
"atacker": "team1",
"defender": "team1",
"testCount": 3,
"testPassed": 1,
"timings (ms)": [-1, 4, -1]
},
{
"atacker": "team2",
"defender": "team1",
"testCount": 50,
"testPassed": 48,
"timings (ms)": [10.6, 90.3, 8.5...............]
},
......
}
}, {
"toolchain": "riscv",
"results": {
{
"atacker": "team1",
"defender": "team1",
"testCount": 3,
"testPassed": 3,
"timings (ms)": [10.6, 90.3, 8.5]
},
{
"atacker": "team1",
"defender": "team2",
"testCount": 3,
"testPassed": 1,
"timings (ms)": [10.6, -1, -1]
},
{
"atacker": "team1",
"defender": "team1",
"testCount": 3,
"testPassed": 1,
"timings (ms)": [-1, 4, -1]
},
{
"atacker": "team2",
"defender": "team1",
"testCount": 50,
"testPassed": 48,
"timings (ms)": [10.6, 90.3, 8.5...............]
},
......
}
}
]
*/
Loading

0 comments on commit f685273

Please sign in to comment.