{"id":442,"date":"2023-02-16T09:54:46","date_gmt":"2023-02-16T09:54:46","guid":{"rendered":"http:\/\/192.168.1.222\/Capitoline\/?page_id=442"},"modified":"2023-09-14T10:57:59","modified_gmt":"2023-09-14T09:57:59","slug":"automated-tests","status":"publish","type":"page","link":"http:\/\/capitoline.twocatsblack.com\/index.php\/automated-tests\/","title":{"rendered":"Recipes and Tests (Rat)"},"content":{"rendered":"\n<p>Cap comes with a bunch of automated recipes, to check I haven&#8217;t broken anything, I run through some predefined tests to create some ROMs, if you have the ROMs and modules that are used for these tests then you can run them and this will check that Cap is (still) working.<br><br>I created these tests for my own use, as occasionally I break things when I update code, and I wanted a bunch of tests to verify that it still works as expected, but you may find some of the ROMs it creates and edits useful too, and of course, you can read the files and see what they do and how they do it, some of the tests will probably seem pointless, but I&#8217;m testing the feature, not just trying to create something useful, if you want me to add a test for the ROM you want to create, I can do that too!<br><br>The logs for the tests are saved under &#8220;Tests&#8221; and the outputs are under &#8220;Outputs&#8221;, the code checks that the files have been created correctly with matching CRC32&#8217;s, as always, no ROMs are included here, if a test fails, that might be because you don&#8217;t have the ROMs\/modules needed, so don&#8217;t panic!<br><br>By the way, a test will generally use the hashes of the ROMs and Components rather than than the filenames because I won&#8217;t know where yours are stored or what they are called (they <strong><em>must<\/em><\/strong> be under ROMs\/Components), so I do an &#8220;auditfiles ROMs&#8221; first to scan all available ROMs or &#8220;auditfiles Components&#8221; to find specific components, I can then find it by it&#8217;s hash value in the form &#8220;$0x00000000&#8221;.<\/p>\n\n\n\n<h2 class=\"wp-block-heading has-large-font-size\">Running them<\/h2>\n\n\n\n<p>There&#8217;s three\/four different rats, two\/three CLI based ones and a Windows GUI, before you run the tests, copy your ROMs to <strong>ROMs<\/strong>, ADFs to <strong>ADFs <\/strong>and Components to <strong>Components<\/strong>, remember, no ROMs are included here, so all the tests will fail if you don&#8217;t do this first.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>For Linux and MacOS in your shell just cd into the Capitoline directory and run <strong>.\/rat.bash<\/strong><\/li>\n\n\n\n<li>For Windows, open a command prompt, cd into the Capitoline directory and run <strong>rat.ba<\/strong>t<br>rat.bat doesn&#8217;t pause so you may miss the summary if you double click from explorer (maybe I&#8217;ll add a pause)<\/li>\n\n\n\n<li>For the Windows GUI, double click on <strong>RatGUI.exe<\/strong><\/li>\n<\/ul>\n\n\n\n<p>Rat will create your ROMs and other output under Capitoline\/Tests\/Output, a red X means it failed, a yellow triangle means it&#8217;s running and a green tick means it&#8217;s OK, they are grouped up, so a red cross means at least one failed, this should only be because you don&#8217;t have a required component or ROM.<br>The GUI isn&#8217;t very responsive when it runs, so just let it finish the tests before poking with it.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"542\" height=\"667\" src=\"http:\/\/capitoline.twocatsblack.com\/wp-content\/uploads\/2023\/03\/rat.jpg\" alt=\"\" class=\"wp-image-609\" srcset=\"http:\/\/capitoline.twocatsblack.com\/wp-content\/uploads\/2023\/03\/rat.jpg 542w, http:\/\/capitoline.twocatsblack.com\/wp-content\/uploads\/2023\/03\/rat-244x300.jpg 244w\" sizes=\"auto, (max-width: 542px) 100vw, 542px\" \/><\/figure>\n\n\n\n<p>Here&#8217;s an example of the Rat command line output<\/p>\n\n\n\n<pre class=\"wp-block-code has-black-color has-text-color\"><code>mikey@DL380:\/Mikey\/Capitoline$ .\/rat.bash\n====================================\n        Recipes and Tests\n           Linux\/MacOS\n------------------------------------\n\n====================================\nA1200.Classic.1Mb\n------------------------------------\nDeleting any previous output...\nRunning test...\nChecking output files...\nA1200.Classic.1Mb.F8...OK\nA1200.Classic.1Mb.E0...OK\nTest OK\n====================================\nHyperion.3.2.1.1Mb.A1200\n------------------------------------\nDeleting any previous output...\nRunning test...\nChecking output files...\nHyperion.3.2.1.1Mb.A1200.F8...OK\nHyperion.3.2.1.1Mb.A1200.E0...OK\nHyperion.3.2.1.1Mb.A1200.hi.bin...OK\nHyperion.3.2.1.1Mb.A1200.lo.bin...OK\nTest OK\n====================================\nHyperion.3.2.1.1Mb.A600\n------------------------------------\nDeleting any previous output...\nRunning test...\nChecking output files...\nHyperion.3.2.1.1Mb.A600.F8...OK\nHyperion.3.2.1.1Mb.A600.E0...OK\nHyperion.3.2.1.1Mb.A600.0.bin...OK\nHyperion.3.2.1.1Mb.A600.1.bin...OK\nHyperion.3.2.1.1Mb.A600.bs.bin...OK\nTest OK\n====================================\nHyperion.3.2.1.with.TerribleFire\n------------------------------------\nDeleting any previous output...\nRunning test...\nChecking output files...\nHyperion.3.2.1.withehide...OK\nHyperion.3.2.1.withehide.hi.bin...OK\nHyperion.3.2.1.withehide.lo.bin...OK\nTest OK\n====================================\nFuria.3.1.8Mb.PCMCIA\n------------------------------------\nDeleting any previous output...\nRunning test...\nChecking output files...\nFuria.8Mb.PCMCIA...OK\nTest OK\n====================================\nBootable.1.3\n------------------------------------\nDeleting any previous output...\nRunning test...\nChecking output files...\nBootable.1.3.bin...OK\nTest OK\n====================================\nKickstart.v2.05.v37.350.skick\n------------------------------------\nDeleting any previous output...\nRunning test...\nChecking output files...\nkick37350.A600.RTB...OK\nTest OK\n====================================\nPatch.v2.05.r37.299.to.r37.300\n------------------------------------\nDeleting any previous output...\nRunning test...\nChecking output files...\nKickstart v2.05 r37.300 (1991-11)(Commodore)(A600HD)&#91;!].rom...OK\nTest OK\n====================================\nSummary\n------------------------------------\n19 files of 19 OK\n8 tests of 8 OK\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading has-medium-font-size\">1Mb Classic ROMs<\/h2>\n\n\n\n<p><strong>A1200.Classic.1Mb<\/strong><br>This test creates a &#8220;classic&#8221; (v3.1) ROM for the A1200, I put a couple of modules in the extended ROM, in this case the <a href=\"http:\/\/aminet.net\/driver\/media\/CFD133.lha\">compactflash.device<\/a> and <a href=\"http:\/\/aminet.net\/disk\/misc\/fat95.lha\">fat95<\/a> driver, you&#8217;ll need to copy the files (compactflash.device and fat95) out of the archive and put them under &#8220;Components&#8221;, you can use <a rel=\"noreferrer noopener\" href=\"https:\/\/www.7-zip.org\/\" data-type=\"URL\" data-id=\"https:\/\/www.7-zip.org\/\" target=\"_blank\">7Zip <\/a>or other tool for this if you don&#8217;t have lha available.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong># Needs the A1200 v3.1 (r40.68) ROM, compactflash.device and fat95 driver<\/strong>\n\n0xbddca450 Tests\/Output\/A1200.Classic.1Mb.F8\n0x9dded63f Tests\/Output\/A1200.Classic.1Mb.E0\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading has-medium-font-size\">1Mb Hyperion ROMs, with Workbench and Icon libraries<\/h2>\n\n\n\n<p><strong>Hyperion.1Mb.A600<\/strong><br>This test creates a Hyperion 3.2.1 ROM with workbench.library and icon.library for the A600, two separate ROMs and two byteswapped files suitable for burning to an EPROM (ending 0.bin and 1.bin, assuming you&#8217;re using a TL866 and it can only burn 512k at a time, different burners could perhaps do the complete 1Mb at a time, the file just ending bs.bin, or if you don&#8217;t want it bytesswapped, just ending .bin).<br><br>There&#8217;s plenty of space in the E0 ROM, so you could add the PCMCIA\/fat95 drivers or anything else you fancy.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong># Needs the Hyperion 3.2.1 ROM and the A600 Modules ADF<\/strong>\n\n0xc01253dd Tests\/Output\/Hyperion.1Mb.A600.F8\n0xbfeb091e Tests\/Output\/Hyperion.1Mb.A600.E0\n\n0x84c7724f Tests\/Output\/Hyperion.1Mb.A600.0.bin\n0x1a7e29d1 Tests\/Output\/Hyperion.1Mb.A600.1.bin\n0x533cfa87 Tests\/Output\/Hyperion.1Mb.A600.bs.bin\n0x71c37da6 Tests\/Output\/Hyperion.1Mb.A600.bin<\/code><\/pre>\n\n\n\n<p><strong>Hyperion.1Mb.A1200<\/strong><br>As above, his test creates a Hyperion 3.2.1 ROM with workbench.library and icon.library for the A1200, two separate ROMs and two byteswapped files suitable for burning to EPROMS<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong># Needs the Hyperion 3.2.1 ROM and the A1200 Modules ADF<\/strong>\n\n0x5bfc4955 Tests\/Output\/Hyperion.1Mb.A1200.F8\n0xbfeb091e Tests\/Output\/Hyperion.1Mb.A1200.E0\n\n0xbbaf4a4e Tests\/Output\/Hyperion.1Mb.A1200.lo.bin\n0x67bcddce Tests\/Output\/Hyperion.1Mb.A1200.hi.bin<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading has-medium-font-size\">Inserting modules into spare ROM space<\/h2>\n\n\n\n<p><strong>Hyperion.3.2.1.with.TerribleFire<\/strong><br>This test creates a 512k Hyperion 3.2.1 ROM for the A1200 but includes the ehide module, it also creates two byteswapped files suitable for burning to a pair of EPROMs.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong># Needs the Hyperion 3.2.1 ROM and the ehide library\n<\/strong>\n0x2b653371 Tests\/Output\/Hyperion.3.2.1.withehide\n\n0x1efb5126 Tests\/Output\/Hyperion.3.2.1.withehide.lo.bin\n0xbd91b16d Tests\/Output\/Hyperion.3.2.1.withehide.hi.bin\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading has-medium-font-size\">Replacing individual modules in a ROM<\/h2>\n\n\n\n<p><strong>Furia.8Mb.PCMCIA<\/strong><br>This test creates a 512k v3.1\/r40.63 for the A600, replacing the original cardres.device with a patched one which doesn&#8217;t disable the PCMCIA slot when you have an 8Mb RAM card, specifically, this was for the Furia with an onboard 8Mb memory but it might work for other machine\/card combinations.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong># Needs the A600 3.1 ROM (r40.63) and the patched <a rel=\"noreferrer noopener\" href=\"http:\/\/eab.abime.net\/showpost.php?p=1172678&amp;postcount=226\" data-type=\"URL\" data-id=\"http:\/\/eab.abime.net\/showpost.php?p=1172678&amp;postcount=226\" target=\"_blank\">cardres.device<\/a>\n<\/strong>\n0x61b54b0c Tests\/Output\/Furia.8Mb.PCMCIA<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading has-medium-font-size\">Completely custom ROM<\/h2>\n\n\n\n<p><strong>Bootable.1.3<\/strong><br>This test creates a 512k ROM based on the A500 v1.3 ROM but adds in a scsi.device from the A600 v3.1 ROM, this is actually way more complex than this because it needs to create a bootlist (so it&#8217;s bootable) and initialise a real (or fake) Gayle, so there&#8217;s quite a lot of patching involved, it&#8217;s useful for 68kide based RAM cards.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong># Needs the A500 v1.3 ROM (not the A3000 one) and the A600 3.1 ROM (r40.63)<\/strong>\n\n0x642e7e05 Tests\/Output\/Bootable.1.3.bin<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading has-medium-font-size\">skick<\/h2>\n\n\n\n<p><strong>Kickstart.v2.05.v37.350.skick<\/strong><br>This test creates an skick (RTB) file from the v2.05 r37.350 ROM designed for the A600, to test this you need to put this file in the Kickstarts folder and also a copy of the A600 ROM (note, this must be named kick37350.A600) then just call &#8220;skick Kickstarts\/kick37350.A600&#8221; and your Amiga should soft kick up as r37.350.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong># Needs the A600 v2.05 ROM v37.350 for the A600<\/strong>\n\n0x3800b380 Tests\/Output\/kick37350.A600.RTB<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading has-medium-font-size\">Simple patching <\/h2>\n\n\n\n<p><strong>Kickstart v2.05 r37.300 (1991-11)(Commodore)(A600HD)[!].rom<\/strong><br>This test recreates the v37.300 ROM exactly from the v37.299 ROM.<br><br>The r37.299 ROM was actually created after the r37.300 ROM, and only varies by six bytes, the version number (300-&gt;299), the LIBHEADER for the scsi.device driver (0x4AFC-&gt;0x0000), and the checksum (0xDB27680D-&gt;0x2623680F) yes, all the device code is in the ROM, just disabled from loading automatically. I suspect this was a cynical marketing ploy to upsell\/distinguish the A600 from the A600HD, or perhaps, more generously, disabling the scsi.device allows a slightly faster boot when you don&#8217;t have a hard drive, although, if you want a faster boot, you&#8217;d want to skip the entire scsi.device code.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong># Needs the A600 v2.05 ROM v37.299 for the A600<\/strong>\n\n0x64466c2a Tests\/Output\/Kickstart v2.05 r37.300 (1991-11)(Commodore)(A600HD)&#91;!].rom<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading has-large-font-size\">Creating your own<\/h2>\n\n\n\n<p>To create your own tests you need to do three things, pick a name for your test, in this case &#8220;mytest&#8221;, you must use this name consistently when you create your files.<br>Be warned, remember to save your files somewhere safe if you update Cap as your files might be overwritten!<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong># File(s) and locations<\/strong>\nTests\/ (folder where all the tests are)\nTests\/Tests.txt (a list of all the tests to run)\nTests\/<strong>mytest<\/strong>.test (the specific test script)\nTests\/<strong>mytest<\/strong>.expected (the files that your script is expected to create)\nTests\/Logs\/<strong>mytest<\/strong>.log (the log that the system will create)<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading has-medium-font-size\">#1 Create the *.test file<\/h2>\n\n\n\n<p>Under the Tests directory\/folder just create a file with a unique name, e.g. &#8220;mytest.test&#8221;, this will be a script, exactly the same as the others, it&#8217;s very, very important that you have an &#8220;exit&#8221; line in the script or it may just hang when you run it, waiting for an exit.<\/p>\n\n\n\n<h2 class=\"wp-block-heading has-medium-font-size\">#2 Create the *.expected file<\/h2>\n\n\n\n<p>Under the Tests directory\/folder just create a file with a unique name, e.g. &#8220;mytest.expected&#8221;, this will be a list of files that your script will create, the file is split into two fields, the CRC32 of the expected file and the path to the file, if you don&#8217;t know the CRC32 then it will appear that the test will fail as it uses this to validate that the test worked.<br>The expected file MUST be named in a similar way to the *.test (the first bit &#8220;mytest&#8221; must match, this is the name of the test)<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>0x789a123b Tests\/Output\/mytestrom.rom<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading has-medium-font-size\">#3 Add the test to the list of tests<\/h2>\n\n\n\n<p>Edit the file Tests\/Tests.txt, if you add a heading (with a leading #) then this will be the heading in Rat, in this case &#8220;My Custom Tests&#8221;, then list your test, in this case &#8220;mytest&#8221; (note, no .test &#8211; just the name without .test on the end)<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#My Custom Tests\nmytest\r<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Cap comes with a bunch of automated recipes, to check I haven&#8217;t broken anything, I run through some predefined tests to create some ROMs, if you have the ROMs and modules that are used for these tests then you can run them and this will check that Cap is (still) working. I created these tests &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"\" href=\"http:\/\/capitoline.twocatsblack.com\/index.php\/automated-tests\/\"> <span class=\"screen-reader-text\">Recipes and Tests (Rat)<\/span> Read More &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"site-sidebar-layout":"default","site-content-layout":"default","ast-global-header-display":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","footnotes":""},"class_list":["post-442","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"http:\/\/capitoline.twocatsblack.com\/index.php\/wp-json\/wp\/v2\/pages\/442","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/capitoline.twocatsblack.com\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"http:\/\/capitoline.twocatsblack.com\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"http:\/\/capitoline.twocatsblack.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/capitoline.twocatsblack.com\/index.php\/wp-json\/wp\/v2\/comments?post=442"}],"version-history":[{"count":2,"href":"http:\/\/capitoline.twocatsblack.com\/index.php\/wp-json\/wp\/v2\/pages\/442\/revisions"}],"predecessor-version":[{"id":767,"href":"http:\/\/capitoline.twocatsblack.com\/index.php\/wp-json\/wp\/v2\/pages\/442\/revisions\/767"}],"wp:attachment":[{"href":"http:\/\/capitoline.twocatsblack.com\/index.php\/wp-json\/wp\/v2\/media?parent=442"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}