rubyx/test/mains
Torsten a3effe29f6 adding integer compare tests and fixing returns
true, false and nll were not handled correctly as returns
returns assume int, and reduce. The solution (hack?) is to add fake numbers into true,false and nil that get returned from from the arm syscall
(and it works!, which means i can fix other tests now)
2020-03-28 18:41:59 +02:00
..
source Removing preloads from mains tests 2019-09-24 22:05:38 +03:00
helper.rb add decent method to get the programs return to interpreter 2020-03-28 18:39:49 +02:00
README.md Removing preloads from mains tests 2019-09-24 22:05:38 +03:00
test_arm.rb arm tests back on line 2020-03-26 20:30:47 +02:00
test_assign.rb better framework for running arm test 2020-03-26 20:28:59 +02:00
test_calling.rb moving more tests to arm 2020-03-27 20:18:14 +02:00
test_class.rb make class method tests arm tests 2020-03-28 09:36:16 +02:00
test_conditional.rb move conditional test to arm 2020-03-28 11:51:16 +02:00
test_int_cmp.rb adding integer compare tests and fixing returns 2020-03-28 18:41:59 +02:00
test_int_math.rb move math code to arm 2020-03-28 12:25:53 +02:00
test_interpreted.rb Removing preloads from mains tests 2019-09-24 22:05:38 +03:00
test_new.rb arm tests back on line 2020-03-26 20:30:47 +02:00
test_while.rb move more tests from interpreter to mains 2020-03-27 19:04:10 +02:00

Mains testing

Test methods by their output and exit codes (return, since it is the main).

There are only two tests here (plus one, see below), one for interpreter, one for arm. Both run the same tests. The actual ruby code that is run is in the source dir. Test methods are generated, one for each source file.

Files

File names follow [order,name,stdout,exitcode] joined by _ pattern. Stdout may be left blank, but exit code must be supplied.

The order number is some number giving the difficulty of the test, higher is more. The first digit represents how many external methods the code relies on, the second is some general indicator, ie recursive is more difficult than not, syscalls more than normal calls, if or while more than nothing etc.

Arm

Obviously the arm tests need an arm platform. This may be defined by ARM_HOST, eg for simulated ARM_HOST=localhost

Also port and user may be specified with ARM_PORT and ARM_USER , they default to 2222 and pi if left blank. SSH keys must be set up so no passwords are required (and the users private key may not be password protected)

Developing

Since the Framework always runs all tests, it is a little cumbersome for developing a single new test. Since all get run and it is slow.

To develop the next test, one can edit test_new.rb . Once it runs on the interpreter, move the changes to a source file and revert test_new changes.