iamleeg / Amiga-Smalltalk

An implementation of Blue Book Smalltalk-80
European Union Public License 1.2
17 stars 0 forks source link

Amiga-Smalltalk

It's Smalltalk. For Amiga. It was made by following the instructions in the Blue Book: Smalltalk-80: The Language and Its Implementation.

VM Tests

A note on comments

Doxygen comments were added by the Amiga-Smalltalk authors, as were all /* block comments */.

/*ST: line comments are transcribed from the Blue Book. */ These were originally BCPL-style // comments, but those aren't in the C89 standard and many Amiga compilers won't accept them.

Page numbers, if not otherwise clarified, refer to pages in the single printed edition of the Blue Book.

Building the tests

In Debianish Linux

You need the AxRuntime, which is included in vendor/. Note that once you've installed the packages you (currently) need to link against the included version of the library, which addresses a crash on process quit that made successful tests look like failures.

make check will build and run the tests.

Building with AROS metamake

  1. Check this folder out somewhere in the AROS source tree (e.g. /path/to/aros-src/local/AmigaSmalltalk).
  2. cd /path/to/aros-src
  3. ./configure
  4. make local-amigasmalltalktests
  5. The tests are available in AROS as :local/AmigaSmalltalk/AmigaSmalltalkTests.

On Amiga

You need these prerequisites:

You should be able to find things on Aminet, though the NDK is a proprietary product so you're on your own there. If you don't have it, try the headers from AROS.

Having installed vbcc and the NDK, add this in S:User-Startup:

assign NDK: HD0:path/to/NDK_3.9
setenv NDK NDK:

Now you can make and run the tests:

1.HD0:Amiga-Smalltalk> amake -f Makefile.vbcc ast_tests
1.HD0:Amiga-Smalltalk> ast_tests

So far this has been tested on A1200 (real and virtual).

On a Mac

You need these prerequisites:

Now you can make the tests with

make -f Makefile.vbcc ast_tests

For bonus points, and if you have FS-UAE already working (giving you an Amiga SYS: in a folder on your Mac) you can use vamos from the amazing lallafa amitools suite. Once you have a ~/.vamosrc configured to point to an Amiga SYS: you can run the tests with

vamos -v -m8192 ast_tests

error_host

error_host is a tool that simulates a VM error, to make sure that it displays the UI correctly. Just build and run to see an uninspiring error message :).

A note on the tests

While these tests mostly look like unit tests, they're actually integration tests because they use the real RealWordMemory even when testing the Interpreter. A test suite gets a new, blank RealWordMemory on each run. You should be aware of these gotchas in your test design:

Copying

Amiga-Smalltalk is made available under the terms of the European Union Public License, version 1.2. See LICENSE.txt.