Page MenuHomePhabricator

Answer to Jack's question (13 Dec)

Authored by jcmcdonald on Dec 13 2022, 5:06 AM.
#include <iostream>
#include "iosqueak/blueshell.hpp"
#include "goldilocks/test.hpp"
using _register = std::function<int(std::deque<std::string>&)>;
class Goldilocks_Shell: public Blueshell{
/* information about the a specific test */
int about(std::deque<std::string>& tests);
/* Runs a benchmark on [test], using its registered
* comparative, with (number) repetitions. */
int benchmark(Test&, int);
/* Runs a comparative benchmark between [test1] and
* [test2] with (number) repetitions. This is seldom
* used, as its prone to apples-and-oranges comparisons,
* unlike benchmark, but it can be useful at times. */
int compare(Test&, Test&, int);
// All member functions must be declared in the header first, at least as a prototype (no body).
void start_shell();
void test();
//In the cpp file
#include "../include/goldilocks/goldilocks_shell.hpp"
// Then we declare the actual implementations here.
void Goldilocks_Shell::start_shell(){
std::cout<<"Running start_shell\n";
void Goldilocks_Shell::test(){std::cout<<"Testing\n";}
int Goldilocks_Shell::about(std::deque<std::string>& options){
std::cout<< "About is running\n"<<options.size();
return 0;

Event Timeline

jcmcdonald changed the title of this paste from untitled to Answer to Jack's question (13 Dec).
jcmcdonald updated the paste's language from autodetect to cpp.