This is the mail archive of the cgen@sourceware.org mailing list for the CGEN project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

new .internal-test pmacro


fyi,
I wanted a way of writing tests while keeping them relatively
self-contained so I added .internal-test.

2009-08-17  Doug Evans  <dje@sebabeach.org>

	* pmacros.scm (-pmacro-builtin-internal-test): New function.
	(pmacros-init!): Add .internal-test.
	* testsuite/test-utils.sh.in (post_process): Tweak FAIL output.
	* testsuite/testsuite.cpu (internal-verify): New pmacro.
	* doc/pmacros.text: Document .internal-test.

E.g. from testsuite/names-comments-1.test:

# Test handling of names and comments.

test=names-comments-1

source ./test-utils.sh

cpu_file=${test}.test.cpu
rm -f ${cpu_file}

cat > ${cpu_file} <<EOF
(include "${srcdir}/../cpu/simplify.inc")
(include "${srcdir}/testsuite.cpu")

(define-insn (name (add 3))
             (comment (("This is a" " comment")
                       " constructed as a list."))
             (syntax "add3")
	     (semantics (sequence VOID nop))
)

;; Verify the correct insn got created.
;; ??? Also need to verify the comment's contents.
(internal-verify "lists in names" (current-insn-lookup 'add3))
EOF

run_cgen ${cpu_file}

post_process

finish


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]