1
1
mirror of https://github.com/kanaka/mal.git synced 2024-09-11 13:55:55 +03:00
Commit Graph

52 Commits

Author SHA1 Message Date
Ryan Cook
6896b0ab18 add makefile and dockerfile for mal CI for ruby.2 2021-12-13 18:18:16 -06:00
Ryan Cook
c318f495b9 ruby.2 step 1 2021-12-13 18:18:16 -06:00
Ben Harris
9d7fb0fd8d runtest: Treat test timeouts as fatal
If a test times out, that means it hasn't returned a prompt within
reasonable time.  Continuing to type at it is unlikely to be helpful,
since the lack of a prompt indicates that the subprocess has hung, so
subsequent tests are likely to time out as well.

This is particularly annoying in step 5, where the line that usually
times out, "(def! res2 (sum2 10000 0))" has its output ignored, so a
timeout is treated as success, meaning that runtest proceeds to the next
test, which of course also times out.
2020-06-01 15:08:10 +01:00
Ben Harris
ab7ecbbcad runtest: Strip CR on input
Implementations don't generally deliberately emit CR, so any CR we see
was introduced either by the host language runtime or the OS terminal
driver, neither of which we're trying to test.
2020-05-23 11:51:51 +01:00
Ben Harris
d7f5f54c38 runtest: Don't worry about how implementation echoes input
Some of the complexity of runtest is in the way that it insists on
checking whether the implementation managed to echo its input line
correctly.  This isn't really an important part of the implementation,
though, and when using friendly line-editing libraries the echoing can
often end up containing escape sequences.  Simplify things by just
assuming that anything up to the first newline is our input being echoed
back.

This also means that various pre-processing of input is no longer
required.
2020-05-23 11:51:52 +01:00
Joel Martin
e3615597df Revert accidentally pushed close_fds experiment 2020-02-11 10:04:05 -06:00
Joel Martin
88869410d7 DEBUG re-enable (REMOVE ME). 2020-01-23 10:44:19 -06:00
Joel Martin
77489b5906 DISABLE FDs (REMOVE ME). 2020-01-23 10:12:37 -06:00
Joel Martin
ea125102ec FD debug (REMOVE ME). 2020-01-23 09:56:56 -06:00
Joel Martin
9cc6f8ddb6 runtest.py: close FDS on Popen
Be more consistent about what FDs the executing implementation will
have during execution. This makes it more consistent with behavior of
launching the implementation directly.
2020-01-20 17:19:13 -06:00
Ali Mohammad Pur
9d4138ed1e
issue #491
adds a `--crlf` switch to runtest.py
2020-01-15 19:45:33 +03:30
scott-silver
0821b2d458
Add missing word 2019-07-06 11:45:15 -07:00
Joel Martin
ded1d76bf7
Merge pull request #396 from inkydragon/fix-test-on-windows
run test on cygwin
2019-06-03 11:05:00 -04:00
woclass
c89b2a6f7d run test on cygwin 2019-06-02 22:22:52 +08:00
Joel Martin
108d07a2ab Travis: travis_trigger.sh script. 2019-05-30 22:16:46 -05:00
Nicolas Boulenguez
c2b6285ef6 runtest: fix pre-eval option 2019-05-14 19:01:32 +02:00
Joel Martin
18f0ec2150 Runtest should fail on bad test data. Fix interop tests.
The interop tests weren't updated when regex support was added to
runtest for matching output data. This was causing a bunch of
implementations to silently fail while testing interop. Fix runtest.py
to fail on bad test data and fix 21 implementations with the old style
output matches.
2019-01-28 10:27:41 -06:00
Joel Martin
18616b105e runtest: support carriage returns in tests.
This allows carriage returns to be specified in tests which allows
multiline tests to be written i.e. by using Ctrl-V Enter to put
a literal carriage return (^M) into the test definition. The effect of
this is to send a single string to the REPL that contains newlines
which normally can't be done because readline behavior will split it
into two separate lines.
2018-12-10 12:30:58 -06:00
Joel Martin
f6f5d4f2a3 runtest.py: process output/errors as regex match.
Update output test data to be regex compatible.
2018-11-30 14:57:45 -06:00
Joel Martin
96c09dcd40 runtest.py: more generic prompt matching. 2018-11-28 22:19:54 -06:00
Joel Martin
9a66ffcd2e rust: remove rustyline ANSI CSI codes from output 2018-07-13 17:20:44 -05:00
Joel Martin
e17aef048e Misc fixes and TODO updates.
- Truncate ruby and python stacktraces since they can get very long
  in certain cases causing problems.
- Fix Clojure West example with proper escaping.
2017-09-15 00:00:23 -05:00
Joel Martin
16d5b0c305 runtest: print errors before first prompt.
- Also, remove extraneous ffi module dep in miniMAL.
2017-02-11 12:54:34 -06:00
Joel Martin
0e508fa518 Basic: add read-file. Misc basicpp space savings.
- Add read-file which is similar to read-string but from a file name
  rather than a string. This allows steps 0-2 to load although each
  one eventuall crashes with out of memory after evaluating "123"
  a few times.
- basicpp:
    - Renumber the line numbers so they are ordinally increasing. This
      saves 150 or so bytes because GOTO/GOSUB calls have smaller line
      numbers.
    - Shrink 'IF 123' -> 'IF123' for almost 300 byte savings.[:w
    - Simplify PR_MEMORY_SUMMARY output. Save 75 bytes
- Add missing runtest.py change that allows basic tests to pass.
2016-10-23 22:18:08 -05:00
Joel Martin
a1eb30fcc9 Use more common spelling of deferrable.
Deferable is apprently a less common but correct spelling.
2016-05-10 10:26:39 -05:00
Joel Martin
46e2568944 Makefile/runtest/tests: deferable/optional options
- tests/*: marked with deferable and optional runtest flags. Some
  moving around of tests within different sections to more closely
  align with the guide.
- runtest.py has --deferable/--no-deferable and
  --optional/--no-optional to control whether tests marked as
  deferable and optional are tested.
- Makefile: DEFERABLE and OPTIONAL top level flags to be passed to
  runtest when running tests.
- Also, fix problems in java quoting revealed by step7 test changes.
2016-05-09 21:14:15 -05:00
Dov Murik
0072404965 runtest.py: Repeat failed test cases at the bottom 2015-12-14 22:29:12 -05:00
Joel Martin
f3ea3be300 runtest/travis: make soft mode the default.
Switch runtest.py option to --hard instead of --soft. This changes
tests marked as soft into a hard fail tests.
2015-11-09 21:16:38 -06:00
Joel Martin
595376919b Misc cleanup for midwest.io presentation. 2015-11-07 15:31:25 -06:00
Joel Martin
97e2759994 runtest: split debug/log file. Test stats. 2015-10-30 22:29:18 -05:00
Joel Martin
8d78bc26bf All: fix read/print of \\, and \n 2015-10-30 22:05:49 -05:00
Joel Martin
406761e769 ps: fix self-host and runtest.py parsing issue.
- make sure readline has large enough string for steps2-A
- fix keyword? so that it doesn't leave anything extra on the stack
- fix argparse command line parsing so that that the second '--' on
  the command line is not dropped.
2015-10-12 22:14:45 -05:00
Joel Martin
98af2ae360 runtest.py: add --soft option, refactor test reader.
- also, mark later stepA optional as soft.
2015-10-09 09:31:29 -05:00
Joel Martin
5abaa3dc5e runtest.py: add --log-file option.
For logging the full output from the implementation to a file for
debug purposes.
2015-10-07 11:10:32 -05:00
Joel Martin
d2f0f672f4 runtest.py: allow repeated form in output.
This should fix (or rather, workaround)
https://github.com/kanaka/mal/issues/30 where on OS X the input form
is occasionally echo'd twice for some reason.
2015-03-20 08:40:46 -05:00
Joel Martin
b020aa3e77 runtest: exit when child process exits.
Fixes: https://github.com/kanaka/mal/issues/40

- Simplify exception handling by combining keyboard exception into
  other exception handler. Print out output buffer on all exceptions.
2015-03-19 10:49:36 -05:00
Joel Martin
82acd3de8b runtest: set PERL_RL=false, remove --raw.
Thanks to suggestion from Stephen Thirlwall
(99ec06dd23 (commitcomment-10278903))
2015-03-19 08:00:28 -05:00
Joel Martin
92dcc81529 runtest: set INPUTRC to /dev/null
- try and avoid any strange readline init script settings.
2015-03-18 23:51:14 -05:00
Joel Martin
b3c30da9fc runtest: set pty size to fix readline of long lines.
- Also, add a long line test to step0 tests.
- Fix java step0 arg parsing.
- Fix postscript long line reads (larger buffer)
- Add mal step0_repl
2015-03-18 13:08:08 -05:00
Joel Martin
8caf621154 runtest: set TERM=dumb, remove --mono mode 2015-03-18 08:47:01 -05:00
Joel Martin
10034e8272 runtest.py: Ouput current buffer if keyboard interrupt.
Suggestion on https://github.com/kanaka/mal/issues/40#issuecomment-81015115
by https://github.com/boxed
2015-03-15 10:52:59 -05:00
Joel Martin
ab01be1898 runtest.py: split --no-pty from --mono 2015-03-10 13:30:56 -05:00
james sangho nah
8e4628da2c compatible with python 3 2015-03-07 09:32:23 +13:00
Joel Martin
612bfe4af7 runtest.py: cleanup all grandchildren too.
Launch Popen with process group and kill that instead. Use atexit to
register cleanup function rather than direct calls.
2015-03-02 17:36:09 -06:00
Joel Martin
9a3835358a runtest.py: cleanup and rename --redirect to --mono 2015-03-02 13:41:49 -06:00
Joel Martin
96deb6a966 runtest.py: fix C# and VB tests.
It is an ugly fix, but basically, use regular Popen (without pty) when
using mono, and do hardcoded echo of the commands when they are
sent/written. It could be worse I suppose...
2015-03-02 00:23:58 -06:00
Joel Martin
c53af760df runtest.py: fix cleanup to use kill.
Still doesn't work with C# and VB.
2015-03-01 23:41:32 -06:00
Joel Martin
f6c83b2b80 runtest.py: cleanup orphan test processes. 2015-02-28 16:25:00 -06:00
Joel Martin
7907cd904a runtest.py: order of magnitude faster.
C#, VB and Lua tests are broken though.
2015-02-28 15:41:18 -06:00
Joel Martin
cc021efe10 Add step5/9 tests for impls that support it.
- Also remove broken make/tests/*.mk tests. Not used any more.
2014-04-27 17:58:48 -05:00