# 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}
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
# later steps.
REGRESS =
+HARD=
DEFERRABLE=1
OPTIONAL=1
# 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
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)
# 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
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) {
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) {
:: eval-try* ( params env -- maltype )
[ params first env EVAL ]
[
- params second second env new-env [ env-set ] keep
- params second third swap 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 )
: 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
;=>(splice-unquote (1 2 3))
-;>>> optional=True
-;;
-;; -------- Optional Functionality --------
-
;; Testing keywords
:kw
;=>:kw
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
;=>()
;>>> deferrable=True
-;>>> optional=True
;;
-;; -------- Deferrable/Optional Functionality --------
+;; -------- Deferrable Functionality --------
;; Testing evaluation within collection literals
[1 2 (+ 1 2)]
;=>4
;>>> deferrable=True
-;>>> optional=True
;;
-;; -------- Deferrable/Optional Functionality --------
+;; -------- Deferrable Functionality --------
;; Testing let* with vector bindings
(let* [z 9] z)
;/\(1 2 abc "\) def
;=>nil
-;>>> optional=True
-;;
-;; -------- Optional Functionality --------
;; Testing keywords
(= :abc :abc)
(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 --------
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
'(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
`(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
;=>"yes"
-;>>> optional=True
-;;
-;; -------- Optional Functionality --------
-
;; Testing nth, first, rest with vectors
(nth [1] 0)
;=>"yes"
;>>> soft=True
+;>>> optional=True
+;;
+;; ------- Optional Functionality --------------
+;; ------- (Not needed for self-hosting) -------
;; Test that macros use closures
(def! x 2)