add sex-tests
This commit is contained in:
10
Makefile
10
Makefile
@@ -1,12 +1,12 @@
|
|||||||
CHICKEN_C = csc
|
CHICKEN_C = csc
|
||||||
|
|
||||||
MODULES = sexc main modules templates utils
|
MODULES = sexc modules templates utils
|
||||||
OBJ = $(MODULES:%=%.o)
|
OBJ = $(MODULES:%=%.o)
|
||||||
|
|
||||||
# chicken flags
|
# chicken flags
|
||||||
CFLAGS = -compile-syntax
|
CFLAGS = -compile-syntax
|
||||||
|
|
||||||
sexc: $(OBJ)
|
sexc: main.o $(OBJ)
|
||||||
$(CHICKEN_C) $^ -o $@
|
$(CHICKEN_C) $^ -o $@
|
||||||
|
|
||||||
main.o: main.scm
|
main.o: main.scm
|
||||||
@@ -15,5 +15,9 @@ main.o: main.scm
|
|||||||
%.o: %.scm
|
%.o: %.scm
|
||||||
$(CHICKEN_C) $< -e -c -o $@ $(CFLAGS)
|
$(CHICKEN_C) $< -e -c -o $@ $(CFLAGS)
|
||||||
|
|
||||||
|
sex-tests: $(OBJ) tests/run.scm
|
||||||
|
$(CHICKEN_C) tests/run.scm -c -o sex-tests.o
|
||||||
|
$(CHICKEN_C) $(OBJ) test.o -o sex-tests
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f $(OBJ) sexc
|
rm -f $(OBJ) sexc sex-tests
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ By the way, there's a way to make Chicken install eggs non-globally. Refer to
|
|||||||
the documentation for more info:
|
the documentation for more info:
|
||||||
https://wiki.call-cc.org/man/5/Extension%20tools#changing-the-repository-location
|
https://wiki.call-cc.org/man/5/Extension%20tools#changing-the-repository-location
|
||||||
|
|
||||||
~chicken-install fmt getopt-long brev-separate~
|
~chicken-install fmt getopt-long brev-separate test~
|
||||||
|
|
||||||
** Compilation
|
** Compilation
|
||||||
~make~
|
~make~
|
||||||
|
|||||||
1
tests/Makefile
Normal file
1
tests/Makefile
Normal file
@@ -0,0 +1 @@
|
|||||||
|
|
||||||
36
tests/run.scm
Normal file
36
tests/run.scm
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
(declare (uses sexc))
|
||||||
|
|
||||||
|
(import
|
||||||
|
(chicken process)
|
||||||
|
(chicken process-context)
|
||||||
|
srfi-1
|
||||||
|
test)
|
||||||
|
|
||||||
|
;;; unkebabify
|
||||||
|
(test '- (unkebabify '-))
|
||||||
|
(test '-- (unkebabify '--))
|
||||||
|
(test '-> (unkebabify '->))
|
||||||
|
(test '-= (unkebabify '-=))
|
||||||
|
(test 'kebab_case (unkebabify 'kebab-case))
|
||||||
|
(test '_what_ (unkebabify '-what-))
|
||||||
|
(test 'this->member (unkebabify 'this->member))
|
||||||
|
(test '_this_->_member_ (unkebabify '-this-->-member-))
|
||||||
|
(test '__->>> (unkebabify '--->>>))
|
||||||
|
|
||||||
|
;;; atom-to-fmt-c
|
||||||
|
(test '%fun (atom-to-fmt-c 'fn))
|
||||||
|
(test '%prototype (atom-to-fmt-c 'prototype))
|
||||||
|
(test '%var (atom-to-fmt-c 'var))
|
||||||
|
(test '%begin (atom-to-fmt-c 'begin))
|
||||||
|
(test '%define (atom-to-fmt-c 'define))
|
||||||
|
(test '%pointer (atom-to-fmt-c 'pointer))
|
||||||
|
(test '%array (atom-to-fmt-c 'array))
|
||||||
|
(test 'vector-ref (atom-to-fmt-c '@))
|
||||||
|
(test '%include (atom-to-fmt-c 'include))
|
||||||
|
(test '%cast (atom-to-fmt-c 'cast))
|
||||||
|
|
||||||
|
;;; make-field-access
|
||||||
|
(test 'a.b (make-field-access '(.b a)))
|
||||||
|
(test 'a.b.c (make-field-access '(.c a.b)))
|
||||||
|
|
||||||
|
(test-exit)
|
||||||
Reference in New Issue
Block a user