mirror of
https://github.com/kanaka/mal.git
synced 2024-10-10 20:38:01 +03:00
Regress test of deferrables. Fix dart, factor.
Add a regression run to Travis that enables hard deferrables but omits optionals so that we can test to make sure that all the requirements are met for self-hosting in stepA. Cleanup up some of the soft/deferrable/optional markings. Deferrables are what will be needed eventually to self host but aren't needed for the immediate next steps. Optional aren't even needed for self-hosting but are nice things to have. Also: - Sync dart step9 and stepA with step8. Do not eval macroexpanded forms in macroexpand form. - Fix stepA of factor which was missing some fixes from step9. - Increase test timeouts in top-level Makefile for guile and io.
This commit is contained in:
parent
7303226945
commit
77fd710cab
@ -109,4 +109,5 @@ script:
|
||||
# Build, test, perf
|
||||
- ./.travis_test.sh build ${IMPL}
|
||||
- ./.travis_test.sh test ${IMPL}
|
||||
- STEP=stepA REGRESS=1 HARD=1 OPTIONAL=0 ./.travis_test.sh test ${IMPL}
|
||||
- ./.travis_test.sh perf ${IMPL}
|
||||
|
@ -61,6 +61,9 @@ test|perf)
|
||||
if ! ${MAKE} TEST_OPTS="${TEST_OPTS}" \
|
||||
${MAL_IMPL:+MAL_IMPL=${MAL_IMPL}} \
|
||||
${REGRESS:+REGRESS=${REGRESS}} \
|
||||
${HARD:+HARD=${HARD}} \
|
||||
${DEFERRABLE:+DEFERRABLE=${DEFERRABLE}} \
|
||||
${OPTIONAL:+OPTIONAL=${OPTIONAL}} \
|
||||
${ACTION}^${IMPL}${STEP:+^${STEP}}; then
|
||||
# print debug-file on error
|
||||
cat ${ACTION}.err
|
||||
|
6
Makefile
6
Makefile
@ -77,6 +77,7 @@ TEST_OPTS =
|
||||
# later steps.
|
||||
REGRESS =
|
||||
|
||||
HARD=
|
||||
DEFERRABLE=1
|
||||
OPTIONAL=1
|
||||
|
||||
@ -142,6 +143,8 @@ dist_EXCLUDES += guile io julia matlab swift
|
||||
|
||||
# Extra options to pass to runtest.py
|
||||
bbc-basic_TEST_OPTS = --test-timeout 60
|
||||
guile_TEST_OPTS = --test-timeout 120
|
||||
io_TEST_OPTS = --test-timeout 120
|
||||
logo_TEST_OPTS = --start-timeout 60 --test-timeout 120
|
||||
mal_TEST_OPTS = --start-timeout 60 --test-timeout 120
|
||||
miniMAL_TEST_OPTS = --start-timeout 60 --test-timeout 120
|
||||
@ -270,6 +273,7 @@ noop =
|
||||
SPACE = $(noop) $(noop)
|
||||
export FACTOR_ROOTS := .
|
||||
|
||||
opt_HARD = $(if $(strip $(HARD)),$(if $(filter t true T True TRUE 1 y yes Yes YES,$(HARD)),--hard,),)
|
||||
opt_DEFERRABLE = $(if $(strip $(DEFERRABLE)),$(if $(filter t true T True TRUE 1 y yes Yes YES,$(DEFERRABLE)),--deferrable,--no-deferrable),--no-deferrable)
|
||||
opt_OPTIONAL = $(if $(strip $(OPTIONAL)),$(if $(filter t true T True TRUE 1 y yes Yes YES,$(OPTIONAL)),--optional,--no-optional),--no-optional)
|
||||
|
||||
@ -328,7 +332,7 @@ get_run_prefix = $(strip $(foreach mode,$(call actual_impl,$(1))_MODE, \
|
||||
# Takes impl and step
|
||||
# Returns the runtest command prefix (with runtest options) for testing the given step
|
||||
get_runtest_cmd = $(call get_run_prefix,$(1),$(2),$(if $(filter cs fsharp mal tcl vb,$(1)),RAW=1,)) \
|
||||
../runtest.py $(opt_DEFERRABLE) $(opt_OPTIONAL) $(call $(1)_TEST_OPTS) $(TEST_OPTS)
|
||||
../runtest.py $(opt_HARD) $(opt_DEFERRABLE) $(opt_OPTIONAL) $(call $(1)_TEST_OPTS) $(TEST_OPTS)
|
||||
|
||||
# Takes impl and step
|
||||
# Returns the runtest command prefix (with runtest options) for testing the given step
|
||||
|
@ -188,8 +188,7 @@ MalType EVAL(MalType ast, Env env) {
|
||||
ast = quasiquote(args.first);
|
||||
continue;
|
||||
} else if (symbol.value == 'macroexpand') {
|
||||
ast = macroexpand(args.first, env);
|
||||
continue;
|
||||
return macroexpand(args.first, env);
|
||||
} else if (symbol.value == 'try*') {
|
||||
var body = args.first;
|
||||
if (args.length < 2) {
|
||||
|
@ -190,8 +190,7 @@ MalType EVAL(MalType ast, Env env) {
|
||||
ast = quasiquote(args.first);
|
||||
continue;
|
||||
} else if (symbol.value == 'macroexpand') {
|
||||
ast = macroexpand(args.first, env);
|
||||
continue;
|
||||
return macroexpand(args.first, env);
|
||||
} else if (symbol.value == 'try*') {
|
||||
var body = args.first;
|
||||
if (args.length < 2) {
|
||||
|
@ -50,8 +50,12 @@ DEFER: EVAL
|
||||
:: eval-try* ( params env -- maltype )
|
||||
[ params first env EVAL ]
|
||||
[
|
||||
params length 1 > [
|
||||
params second second env new-env [ env-set ] keep
|
||||
params second third swap EVAL
|
||||
] [
|
||||
throw
|
||||
] if
|
||||
] recover ;
|
||||
|
||||
: args-split ( bindlist -- bindlist restbinding/f )
|
||||
@ -121,7 +125,11 @@ M: callable apply call( x -- y ) f ;
|
||||
: PRINT ( maltype -- str ) pr-str ;
|
||||
|
||||
: REP ( str -- str )
|
||||
[ READ repl-env get EVAL ] [ nip ] recover PRINT ;
|
||||
[
|
||||
READ repl-env get EVAL PRINT
|
||||
] [
|
||||
nip pr-str "Error: " swap append
|
||||
] recover ;
|
||||
|
||||
: REPL ( -- )
|
||||
"(println (str \"Mal [\" *host-language* \"]\"))" REP drop
|
||||
|
@ -164,10 +164,6 @@ false
|
||||
;=>(splice-unquote (1 2 3))
|
||||
|
||||
|
||||
;>>> optional=True
|
||||
;;
|
||||
;; -------- Optional Functionality --------
|
||||
|
||||
;; Testing keywords
|
||||
:kw
|
||||
;=>:kw
|
||||
@ -221,16 +217,19 @@ false
|
||||
1; comment after expression
|
||||
;=>1
|
||||
|
||||
;; Testing read of ^/metadata
|
||||
^{"a" 1} [1 2 3]
|
||||
;=>(with-meta [1 2 3] {"a" 1})
|
||||
|
||||
|
||||
;; Testing read of @/deref
|
||||
@a
|
||||
;=>(deref a)
|
||||
|
||||
;>>> soft=True
|
||||
;>>> optional=True
|
||||
;;
|
||||
;; -------- Optional Functionality --------
|
||||
|
||||
;; Testing read of ^/metadata
|
||||
^{"a" 1} [1 2 3]
|
||||
;=>(with-meta [1 2 3] {"a" 1})
|
||||
|
||||
|
||||
;; Non alphanumerice characters in strings
|
||||
;;; \t is not specified enough to be tested
|
||||
|
@ -29,9 +29,8 @@
|
||||
;=>()
|
||||
|
||||
;>>> deferrable=True
|
||||
;>>> optional=True
|
||||
;;
|
||||
;; -------- Deferrable/Optional Functionality --------
|
||||
;; -------- Deferrable Functionality --------
|
||||
|
||||
;; Testing evaluation within collection literals
|
||||
[1 2 (+ 1 2)]
|
||||
|
@ -64,9 +64,8 @@ y
|
||||
;=>4
|
||||
|
||||
;>>> deferrable=True
|
||||
;>>> optional=True
|
||||
;;
|
||||
;; -------- Deferrable/Optional Functionality --------
|
||||
;; -------- Deferrable Functionality --------
|
||||
|
||||
;; Testing let* with vector bindings
|
||||
(let* [z 9] z)
|
||||
|
@ -420,9 +420,6 @@ nil
|
||||
;/\(1 2 abc "\) def
|
||||
;=>nil
|
||||
|
||||
;>>> optional=True
|
||||
;;
|
||||
;; -------- Optional Functionality --------
|
||||
|
||||
;; Testing keywords
|
||||
(= :abc :abc)
|
||||
|
@ -101,6 +101,28 @@
|
||||
(fib 2)
|
||||
;=>1
|
||||
|
||||
;; Testing `@` reader macro (short for `deref`)
|
||||
(def! atm (atom 9))
|
||||
@atm
|
||||
;=>9
|
||||
|
||||
;;; TODO: really a step5 test
|
||||
;; Testing that vector params not broken by TCO
|
||||
(def! g (fn* [] 78))
|
||||
(g)
|
||||
;=>78
|
||||
(def! g (fn* [a] (+ a 78)))
|
||||
(g 3)
|
||||
;=>81
|
||||
|
||||
;;
|
||||
;; Testing that *ARGV* exists and is an empty list
|
||||
(list? *ARGV*)
|
||||
;=>true
|
||||
*ARGV*
|
||||
;=>()
|
||||
|
||||
;>>> soft=True
|
||||
;>>> optional=True
|
||||
;;
|
||||
;; -------- Optional Functionality --------
|
||||
@ -119,35 +141,12 @@
|
||||
mymap
|
||||
;=>{"a" 1}
|
||||
|
||||
;; Testing `@` reader macro (short for `deref`)
|
||||
(def! atm (atom 9))
|
||||
@atm
|
||||
;=>9
|
||||
|
||||
;;; TODO: really a step5 test
|
||||
;; Testing that vector params not broken by TCO
|
||||
(def! g (fn* [] 78))
|
||||
(g)
|
||||
;=>78
|
||||
(def! g (fn* [a] (+ a 78)))
|
||||
(g 3)
|
||||
;=>81
|
||||
|
||||
;; Checking that eval does not use local environments.
|
||||
(def! a 1)
|
||||
;=>1
|
||||
(let* (a 2) (eval (read-string "a")))
|
||||
;=>1
|
||||
|
||||
;;
|
||||
;; Testing that *ARGV* exists and is an empty list
|
||||
(list? *ARGV*)
|
||||
;=>true
|
||||
*ARGV*
|
||||
;=>()
|
||||
|
||||
;>>> soft=True
|
||||
|
||||
;; Non alphanumeric characters in comments in read-string
|
||||
(read-string "1;!")
|
||||
;=>1
|
||||
|
@ -119,6 +119,22 @@ b
|
||||
'(1 2 (3 4))
|
||||
;=>(1 2 (3 4))
|
||||
|
||||
;; Testing cons and concat with vectors
|
||||
|
||||
(cons [1] [2 3])
|
||||
;=>([1] 2 3)
|
||||
(cons 1 [2 3])
|
||||
;=>(1 2 3)
|
||||
(concat [1 2] (list 3 4) [5 6])
|
||||
;=>(1 2 3 4 5 6)
|
||||
(concat [1 2])
|
||||
;=>(1 2)
|
||||
|
||||
|
||||
;>>> optional=True
|
||||
;;
|
||||
;; -------- Optional Functionality --------
|
||||
|
||||
;; Testing ` (quasiquote) reader macro
|
||||
`7
|
||||
;=>7
|
||||
@ -151,22 +167,6 @@ b
|
||||
`(1 ~@c 3)
|
||||
;=>(1 1 "b" "d" 3)
|
||||
|
||||
|
||||
;>>> optional=True
|
||||
;;
|
||||
;; -------- Optional Functionality --------
|
||||
|
||||
;; Testing cons and concat with vectors
|
||||
|
||||
(cons [1] [2 3])
|
||||
;=>([1] 2 3)
|
||||
(cons 1 [2 3])
|
||||
;=>(1 2 3)
|
||||
(concat [1 2] (list 3 4) [5 6])
|
||||
;=>(1 2 3 4 5 6)
|
||||
(concat [1 2])
|
||||
;=>(1 2)
|
||||
|
||||
;; Testing unquote with vectors
|
||||
(def! a 8)
|
||||
;=>8
|
||||
|
@ -92,10 +92,6 @@ x
|
||||
;=>"yes"
|
||||
|
||||
|
||||
;>>> optional=True
|
||||
;;
|
||||
;; -------- Optional Functionality --------
|
||||
|
||||
;; Testing nth, first, rest with vectors
|
||||
|
||||
(nth [1] 0)
|
||||
@ -132,6 +128,10 @@ x
|
||||
;=>"yes"
|
||||
|
||||
;>>> soft=True
|
||||
;>>> optional=True
|
||||
;;
|
||||
;; ------- Optional Functionality --------------
|
||||
;; ------- (Not needed for self-hosting) -------
|
||||
|
||||
;; Test that macros use closures
|
||||
(def! x 2)
|
||||
|
Loading…
Reference in New Issue
Block a user