Speaking of tests, some people already know as it was largely discussed on IRC already, but I've integrated the autotester in CEmu as well (at least, just enough, for now, to make it work).

Quick summary: the "autotester" is a tool that allows native CE programmers to create and launch automated unit tests, by creating a test config file (in JSON) like the following:

Code:
{
  "rom": "84pce_515.rom",
  "transfer_files": [
    "graphc_v3.2.8xv",
    "libload_v1.0.8xv",
    "demo1.8xp"
  ],
  "target": {
    "name": "PROG01",
    "isASM": false
  },
  "sequence": [
    "action|launch",
    "delay|500",
    "hash|1",
    "key|enter",
    "delay|500",
    "hash|2"
  ],
  "hashes": {
    "1": {
      "description": "Fill screen in red (TODO: find real hash)",
      "start": "vram_start",
      "size": "vram_8_size",
      "expected_CRCs": [ "A99AE348" ]
    },
    "2": {
      "description": "Back to the home screen (exit check) (TODO: find real hash)",
      "start": "vram_start",
      "size": "vram_16_size",
      "expected_CRCs": [ "6EF61DFC", "97807FAA" ]
    }
  }
}

As you can see, you just have to provide a sequence of actions to be done, and when/where to hash (CRC32), so that it can compare to good values.
That allows you to try out libraries updates, for instance, to avoid regressions Smile

The autotester runs either in standalone (linking with libcemucore), or integrated in CEmu (it has a dock by itself).
Please do report any issue you may find.

As usual, the relevant source code is here: https://github.com/CE-Programming/CEmu/tree/master/tests/autotester
Very cool! I know that at least one other emulator (WabbitEmu, and possibly PTI) has|had a COM interface that you could use to interface with the emulator, issuing keypresses and instructing it to load files. Do you plan to support such a "real-time" automation system as well?
KermMartian wrote:
Very cool! I know that at least one other emulator (WabbitEmu, and possibly PTI) has|had a COM interface that you could use to interface with the emulator, issuing keypresses and instructing it to load files. Do you plan to support such a "real-time" automation system as well?

Well, the autotester has support for key sending, already (basically it calls the appropriate core functions, at a more or less high-level, it depends which ones).
I mean, the implementation of this is pretty simple, and allows this, for program launching already:

Code:
        "launch", [] {
            // Assuming we're in the home screen...
            sendKey(CE_KEY_Clear);
            if (config.target.isASM) {
                sendKey(CE_KEY_Asm);
            }
            sendKey(CE_KEY_prgm);
            for (const char& c : config.target.name) {
                sendLetterKeyPress(c); // type program name
            }
            sendKey(CE_KEY_Enter);
        }


Granted, sendKey is a function jacobly helped me with that probably should be part of the core (or, well, core extensions, like the debugging stuff), so that mor eexternal tools could call that easily.

BTW, it's very fun launching tests in CEmu and see the autotester taking control of the emulator, with keys getting pressed and all Very Happy

So, the autotester CLI version is probably a bit less reliable than the CEmu-integrated one as the latter is better at timing things (and file transfer with threading in general), but it's however much smaller (no GUI...), and from what I've quickly tested, it appears to work fine when built with Emscripten. We could envision a GitHub PR/Commit hook for automated lib testing?

Also, there's https://github.com/CE-Programming/CEmu/issues/19 and https://github.com/CE-Programming/CEmu/issues/16 for even more thoughts about all that.
When I try to get the ROM, every time I press the calculator explorer, it clears my RAM. Does anyone Know why?
CEmu can also now export the CRC code used inside the autotester for quick unit tests to ensure everything is working properly.

In addition, you can now set memory watchpoints, which allow you a ton of control when viewing the status of particular variables in your program. It converts the little-endian format of the data into big endian so it is easier for you to read. You can change the length of the memory watchpoint to be up to 32 bits, and it allows for direct editing of variables in there without having to open the large memory array.

However, perhaps the neatest is the new ability to set breakpoints, watchpoints, and open the debugger in CEmu directly within the code of your program. Using this, there is no need to manually set these yourself; simply use the appropriate routine and CEmu will automatically add it for you.

Here's a document containing the routines that are available for you. Of course, these are just examples, you can chain whatever you would like together in any fashion. These will be added to the C toolchain for even easier debugging shortly.


Code:
;--------------------------------------------------------------------
_openDebugger:
; Opens the debugger for any reason
   scf   
   sbc   hl,hl
   ld   (hl),2
   ret

;--------------------------------------------------------------------
_setBreakpoint:
; Sets a breakpoint at a particular address
; Arguments
;  DE = Address to set as breakpoint
   scf   
   sbc   hl,hl
   ld   (hl),3
   ret
   
;--------------------------------------------------------------------
_removeBreakpoint:
; Removes a breakpoint at a particular address
; Arguments
;  DE = Address of breakpoint to remove
   scf
   sbc   hl,hl
   ld   (hl),4
   ret
   
;--------------------------------------------------------------------
_setReadWatchpoint:
; Sets a read watchpoint at a particular address
; Arguments
;  DE = Address of watchpoint to set
;   C = Length of variable at that address
   scf   
   sbc   hl,hl
   ld   (hl),5
   ret

;--------------------------------------------------------------------
_setWriteWatchpoint:
; Sets a write watchpoint at a particular address
; Arguments
;  DE = Address of watchpoint to set
;   C = Length of variable at that address
   scf
   sbc   hl,hl
   ld   (hl),6
   ret

;--------------------------------------------------------------------
_setReadWriteWatchpoint:
; Sets a read and write watchpoint at a particular address
; Arguments
;  DE = Address of watchpoint to set
;   C = Length of variable at that address
   scf
   sbc   hl,hl
   ld   (hl),7
   ret
   
;--------------------------------------------------------------------
_removeWatchpoint:
; Removes a watchpoint at a particular address
; Arguments
;  DE = Address of watchpoint to remove
   scf
   sbc   hl,hl
   ld   (hl),8
   ret

;--------------------------------------------------------------------
_removeAllBreakpoints:
; Removes all set breakpoints
; Arguments
;  None
   scf
   sbc   hl,hl
   ld   (hl),9
   ret
   
;--------------------------------------------------------------------
_removeAllWatchpoints:
; Removes all set breakpoints
; Arguments
;  None
   scf
   sbc   hl,hl
   ld   (hl),10
   ret

;--------------------------------------------------------------------
_setWatchpoint:
; Sets a non breaking watchpoint
; Arguments
;  DE = Address of watchpoint to set
;   C = Length of variable at that address
   scf
   sbc   hl,hl
   ld   (hl),11
   ret


Adding breakpoints and watchpoints has also been improved, along with the speed optimizations as well. You may notice the OS seems a lot faster than usual; this is because of the ongoing work to resolve DMA issues.

Here's a current screenshot.


calcnerd_CEP_D wrote:
When I try to get the ROM, every time I press the calculator explorer, it clears my RAM. Does anyone Know why?

I'll look into it. Have you gotten it to work, by chance?
Now that is a feature I can not wait to play with. It was one of the few things wabbitemu was seriously lacking in. Software breakpoints are the best. Yaaaaay.
calcnerd_CEP_D wrote:
When I try to get the ROM, every time I press the calculator explorer, it clears my RAM. Does anyone Know why?


Ok, I got it to work. Apparently, I had to much memory full, so I deleted a ton of useless stuff. The calculator explorer works fine now, though I can't figure out how to import things to the computer. Any help on that?
calcnerd_CEP_D wrote:
calcnerd_CEP_D wrote:
When I try to get the ROM, every time I press the calculator explorer, it clears my RAM. Does anyone Know why?


Ok, I got it to work. Apparently, I had to much memory full, so I deleted a ton of useless stuff. The calculator explorer works fine now, though I can't figure out how to import things to the computer. Any help on that?

Click on the first ROMData variable, hold shift, click on the last ROMData variable, and choose the 'Send to computer' option (located under the Actions tab, crtl+L, or by right clicking on the selected items)
How can I get the LCD to load? all it says for me is "LCD OFF" Which is slightly frustrating
Domino 464 wrote:
How can I get the LCD to load? all it says for me is "LCD OFF" Which is slightly frustrating


Press the ON button?
Yep. Still off
I'm not sure if it's the same issue as here: https://github.com/CE-Programming/CEmu/issues/73
But in which case (unexplained for now), you would just need to manually turn on the LCD, ie go to the Debug tab, Misc sub-tab, and check PWR of the LCD area.

Also, sometimes it can happen that a key gets stuck (most likely the Alpha key if you're using the CEmu keybindings as it gets triggered by Alt-tabs), so make sure to release all of them (in the case of the Alpha key, press it a few times to be sure)
It is actually the same issue, thanks, I'm going to try to fix this ^^
--update--
Here we go, I went into the Debug Tab on CEmu, stopped the emulation, and checked the LCD state PWR box. Its working fine now! (as of right now)
A few updates I've made recently :
  • Fix possible crash at launch after initial setup
  • Better variable list view: now sortable, has a context menu to show item in memory and launch programs directly
  • Fix LCD-related issue (bad masking on LCD port write handler)
  • Fix Mac UI spacing in the popout LCD
  • Various minor bugs fixed

A bit before that, Mateo had fixed a crash related to breakpoints/watchpoints handling in certain cases, and added some port mirroring support.

More details: https://github.com/CE-Programming/CEmu/commits/master

Also, good news, jacobly resumed his work on the new keypad, lighter, prettier, faster, more customizable, more powerful, etc. Razz
I've tried to build CEmu using the directions on the website, but Qt keeps coming up with an error code:

:-1: error: No rule to make target 'mainwindow.ui', needed by 'ui_mainwindow.h'. Stop.

What do I do?
Please see what I posted in the wabbitemu topic, you don't have to build it yourself, pimath has automated the process so all you have to do is visit a link and download a zip file. Wink
pimath hosts daily builds here: http://pimathbrainiac.me/CEmu/

Very useful and well worth a big thankyou!
So started to add some CLI arguments. Which makes it possible for us to do something like this Very Happy
http://i.imgur.com/e6Utbck.gifv

Pretty much we can now call the auto tester on the GUI from the command line. Which is quite nice Very Happy
tr1p1ea wrote:
pimath hosts daily builds here: http://pimathbrainiac.me/CEmu/

Very useful and well worth a big thankyou!

Even after being out offline for a while I still appreciate the thanks! In other news, I have officially have a job, so the VPS is no longer on a time limit from the Github student pack.
How do you add appvars to CEmu?
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
» Goto page Previous  1, 2, 3 ... 5, 6, 7 ... 12, 13, 14  Next
» View previous topic :: View next topic  
Page 6 of 14
» All times are GMT - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement