about summary refs log tree commit diff stats
path: root/html
Commit message (Expand)AuthorAgeFilesLines
...
* 7472Kartik Agaram2020-12-291-0/+93
* 7468Kartik Agaram2020-12-294-55/+59
* 7464Kartik Agaram2020-12-292-0/+169
* 7438Kartik Agaram2020-12-283-244/+600
* 7429Kartik Agaram2020-12-271-0/+0
* 7427Kartik Agaram2020-12-272-2/+2
* 7426Kartik Agaram2020-12-272-16/+113
* 7405Kartik Agaram2020-12-263-0/+875
* 7398Kartik Agaram2020-12-231-2/+2
* 7397Kartik Agaram2020-12-231-346/+376
* 7396Kartik Agaram2020-12-231-0/+371
* 7335Kartik Agaram2020-12-0416-2083/+3033
* 7324Kartik Agaram2020-12-022-0/+370
* 7319Kartik Agaram2020-12-022-0/+339
* 7316Kartik Agaram2020-12-012-184/+210
* 7314Kartik Agaram2020-12-011-0/+163
* 7311Kartik Agaram2020-12-0111-2799/+2845
* 7307Kartik Agaram2020-11-291-441/+433
* 7306Kartik Agaram2020-11-2943-37925/+40204
* 7278 - typo in mu.subxKartik Agaram2020-11-261-2/+2
* 7267 - mu.subx: type-check 'convert' statementsKartik Agaram2020-11-201-21696/+22283
* 7266Kartik Agaram2020-11-171-6/+6
* 7262Kartik Agaram2020-11-176-28501/+28788
* 7259Kartik Agaram2020-11-171-0/+0
* 7252Kartik Agaram2020-11-1618-1444/+1444
* 7251Kartik Agaram2020-11-161-2/+2
* 7250Kartik Agaram2020-11-163-3/+3
* 7249Kartik Agaram2020-11-1515-35694/+36870
* 7227Kartik Agaram2020-11-1140-36171/+37727
* 7203Kartik Agaram2020-11-061-0/+27
* 7187Kartik Agaram2020-11-0516-23760/+27189
* 7175Kartik Agaram2020-11-0320-28068/+29016
* 7162Kartik Agaram2020-11-0283-33153/+37215
* 7147Kartik Agaram2020-10-311-4/+7
* 7146Kartik Agaram2020-10-311-87/+87
* 7088Kartik Agaram2020-10-2010-1322/+3168
* 7032Kartik Agaram2020-10-145-405/+413
* 7031Kartik Agaram2020-10-141-1/+1
* 7030Kartik Agaram2020-10-141-2/+2
* 7029Kartik Agaram2020-10-141-39/+42
* 7025Kartik Agaram2020-10-141-0/+389
* 6959Kartik Agaram2020-10-052-962/+415
* 6958Kartik Agaram2020-10-05141-39524/+46411
* 6957Kartik Agaram2020-10-051-0/+9
* 6955Kartik Agaram2020-10-051-27/+30
* 6951 - 4 colors for Mu as wellKartik Agaram2020-10-041-83/+85
* 6950Kartik Agaram2020-10-041-0/+459
* 6938 - start colorizing floating-point registersKartik Agaram2020-10-031-6/+6
* 6937Kartik Agaram2020-10-031-20/+23
* 6936Kartik Agaram2020-10-031-0/+146
trong */ .highlight .gr { color: #aa0000 } /* Generic.Error */ .highlight .gh { color: #333333 } /* Generic.Heading */ .highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */ .highlight .go { color: #888888 } /* Generic.Output */ .highlight .gp { color: #555555 } /* Generic.Prompt */ .highlight .gs { font-weight: bold } /* Generic.Strong */ .highlight .gu { color: #666666 } /* Generic.Subheading */ .highlight .gt { color: #aa0000 } /* Generic.Traceback */ .highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */ .highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */ .highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */ .highlight .kp { color: #008800 } /* Keyword.Pseudo */ .highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */ .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
//: A simple test harness. To create new tests, define functions starting with
//: 'test_'. To run all tests so defined, run:
//:   $ ./mu test
//:
//: Every layer should include tests, and can reach into previous layers.
//: However, it seems like a good idea never to reach into tests from previous
//: layers. Every test should be a contract that always passes as originally
//: written, regardless of any later layers. Avoid writing 'temporary' tests
//: that are only meant to work until some layer.

:(before "End Types")
typedef void (*test_fn)(void);
:(before "Globals")
// move a global ahead into types that we can't generate an extern declaration for
const test_fn Tests[] = {
  #include "test_list"  // auto-generated; see 'build*' scripts
};

:(before "End Globals")
bool Run_tests = false;
bool Passed = true;  // set this to false inside any test to indicate failure

:(before "End Includes")
#define CHECK(X) \
  if (Passed && !(X)) { \
    cerr << "\nF - " << __FUNCTION__ << "(" << __FILE__ << ":" << __LINE__ << "): " << #X << '\n'; \
    Passed = false; \
    return;  /* Currently we stop at the very first failure. */ \
  }

#define CHECK_EQ(X, Y) \
  if (Passed && (X) != (Y)) { \
    cerr << "\nF - " << __FUNCTION__ << "(" << __FILE__ << ":" << __LINE__ << "): " << #X << " == " << #Y << '\n'; \
    cerr << "  got " << (X) << '\n';  /* BEWARE: multiple eval */ \
    Passed = false; \
    return;  /* Currently we stop at the very first failure. */ \
  }

:(before "End Reset")
Passed = true;

:(before "End Commandline Parsing")
if (argc > 1 && is_equal(argv[1], "test")) {
  Run_tests = true;  --argc;  ++argv;  // shift 'test' out of commandline args
}

:(before "End Main")
if (Run_tests) {
  // Test Runs
  // we run some tests and then exit; assume no state need be maintained afterward

  long num_failures = 0;
  // End Test Run Initialization
  time_t t;  time(&t);
  cerr << "C tests: " << ctime(&t);
  for (size_t i=0;  i < sizeof(Tests)/sizeof(Tests[0]);  ++i) {
//?     cerr << "running " << Test_names[i] << '\n';
    run_test(i);
    if (Passed) cerr << '.';
    else ++num_failures;
  }
  cerr << '\n';
  // End Tests
  if (num_failures > 0) {
    cerr << num_failures << " failure"
         << (num_failures > 1 ? "s" : "")
         << '\n';
    return 1;
  }
  return 0;
}

:(code)
void run_test(size_t i) {
  if (i >= sizeof(Tests)/sizeof(Tests[0])) {
    cerr << "no test " << i << '\n';
    return;
  }
  reset();
  // End Test Setup
  (*Tests[i])();
  // End Test Teardown
}

//: Convenience: run a single test
:(before "Globals")
// Names for each element of the 'Tests' global, respectively.
const string Test_names[] = {
  #include "test_name_list"  // auto-generated; see 'build*' scripts
};
:(after "Test Runs")
string maybe_single_test_to_run = argv[argc-1];
if (!starts_with(maybe_single_test_to_run, "test_"))
  maybe_single_test_to_run.insert(0, "test_");
for (size_t i=0;  i < sizeof(Tests)/sizeof(Tests[0]);  ++i) {
  if (Test_names[i] == maybe_single_test_to_run) {
    run_test(i);
    if (Passed) cerr << ".\n";
    return 0;
  }
}

:(before "End Includes")
#include <stdlib.h>