From 104e521c04d1a0cad9c68fb11e250e12ad8917ef Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Wed, 17 Oct 2018 07:08:47 -0700 Subject: 4709 --- html/subx/040---tests.cc.html | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'html/subx/040---tests.cc.html') diff --git a/html/subx/040---tests.cc.html b/html/subx/040---tests.cc.html index b51870bc..ae707d92 100644 --- a/html/subx/040---tests.cc.html +++ b/html/subx/040---tests.cc.html @@ -73,36 +73,36 @@ if ('onhashchange' in window) { 11 % Reg[ESP].u = 0x100; 12 == 0x1 13 main: -14 e8/call run_tests/disp32 # 5 bytes +14 e8/call run-tests/disp32 # 5 bytes 15 f4/halt # 1 byte 16 -17 test_foo: # offset 7 +17 test-foo: # offset 7 18 01 d8 # just some unique instruction: add EBX to EAX 19 c3/return 20 -21 # check that code in test_foo ran (implicitly called by run_tests) +21 # check that code in test_foo ran (implicitly called by run-tests) 22 +run: inst: 0x00000007 23 24 :(code) 25 void create_test_function(program& p) { 26 if (p.segments.empty()) return; -27 segment& code = p.segments.at(0); -28 trace(99, "transform") << "-- create 'run_tests'" << end(); +27 segment& code = p.segments.at(0); +28 trace(99, "transform") << "-- create 'run-tests'" << end(); 29 vector<line> new_insts; -30 for (int i = 0; i < SIZE(code.lines); ++i) { -31 line& inst = code.lines.at(i); +30 for (int i = 0; i < SIZE(code.lines); ++i) { +31 line& inst = code.lines.at(i); 32 for (int j = 0; j < SIZE(inst.words); ++j) { 33 const word& curr = inst.words.at(j); 34 if (*curr.data.rbegin() != ':') continue; // not a label -35 if (!starts_with(curr.data, "test_")) continue; -36 string fn = drop_last(curr.data); +35 if (!starts_with(curr.data, "test-")) continue; +36 string fn = drop_last(curr.data); 37 new_insts.push_back(call(fn)); 38 } 39 } 40 if (new_insts.empty()) return; // no tests found -41 code.lines.push_back(label("run_tests")); -42 code.lines.insert(code.lines.end(), new_insts.begin(), new_insts.end()); -43 code.lines.push_back(ret()); +41 code.lines.push_back(label("run-tests")); +42 code.lines.insert(code.lines.end(), new_insts.begin(), new_insts.end()); +43 code.lines.push_back(ret()); 44 } 45 46 string to_string(const segment& s) { -- cgit 1.4.1-2-gfad0