summaryrefslogtreecommitdiff
path: root/gnuradio-core/src
diff options
context:
space:
mode:
authorEric Blossom2010-11-06 00:38:20 -0700
committerEric Blossom2010-11-10 12:17:57 -0800
commit2f865632e7208dc748fe7f2b8003297730fc133d (patch)
tree3e9b80612e997d20585c3e3d7f9232b2292c1721 /gnuradio-core/src
parent45a88c35386e7ea0d93651cd528bc7c1261d3197 (diff)
downloadgnuradio-2f865632e7208dc748fe7f2b8003297730fc133d.tar.gz
gnuradio-2f865632e7208dc748fe7f2b8003297730fc133d.tar.bz2
gnuradio-2f865632e7208dc748fe7f2b8003297730fc133d.zip
Refactor guile QA code to use test-group.
Diffstat (limited to 'gnuradio-core/src')
-rw-r--r--gnuradio-core/src/guile/qa_0000_basics.scm41
1 files changed, 19 insertions, 22 deletions
diff --git a/gnuradio-core/src/guile/qa_0000_basics.scm b/gnuradio-core/src/guile/qa_0000_basics.scm
index aa4dc37ff..423a49478 100644
--- a/gnuradio-core/src/guile/qa_0000_basics.scm
+++ b/gnuradio-core/src/guile/qa_0000_basics.scm
@@ -27,8 +27,12 @@
(define (vector-map f v)
(list->vector (map f (vector->list v))))
-(define (test-connect-1)
- (let* ((src-data #(-5 -4 -3 -2 -1 0 1 2 3 4 5))
+
+;; Must precede all tests
+(test-begin "qa_0000_basics")
+
+(test-group "test-connect-1"
+ (let* ((src-data #(-5 -4 -3 -2 -1 0 1 2 3 4 5))
(expected-result (vector-map (lambda (x) (* x 2)) src-data))
(tb (gr:top-block-swig "QA top block"))
(src (gr:vector-source-i src-data #f))
@@ -40,10 +44,10 @@
(gr:connect tb (gr:ep op 0) (gr:ep dst 0))
(gr:run tb)
- (let ((actual-result (gr:data dst)))
- (test-equal expected-result actual-result))))
+ (test-equal expected-result (gr:data dst))))
+
-(define (test-connect-2)
+(test-group "test-connect-2"
(let* ((src-data #(-5 -4 -3 -2 -1 0 1 2 3 4 5))
(expected-result (vector-map (lambda (x) (* x 2)) src-data))
(tb (gr:top-block-swig "QA top block"))
@@ -56,10 +60,10 @@
(gr:connect tb op dst)
(gr:run tb)
- (let ((actual-result (gr:data dst)))
- (test-equal expected-result actual-result))))
+ (test-equal expected-result (gr:data dst))))
+
-(define (test-connect-3)
+(test-group "test-connect-3"
(let* ((src-data #(-5 -4 -3 -2 -1 0 1 2 3 4 5))
(expected-result (vector-map (lambda (x) (* x 2)) src-data))
(tb (gr:top-block-swig "QA top block"))
@@ -72,10 +76,10 @@
(gr:connect tb `(,op 0) `(,dst 0))
(gr:run tb)
- (let ((actual-result (gr:data dst)))
- (test-equal expected-result actual-result))))
+ (test-equal expected-result (gr:data dst))))
-(define (test-connect-4)
+
+(test-group "test-connect-4"
(let* ((src-data #(-5 -4 -3 -2 -1 0 1 2 3 4 5))
(expected-result (vector-map (lambda (x) (* x 2)) src-data))
(tb (gr:top-block-swig "QA top block"))
@@ -87,10 +91,10 @@
(gr:connect tb src op dst)
(gr:run tb)
- (let ((actual-result (gr:data dst)))
- (test-equal expected-result actual-result))))
+ (test-equal expected-result (gr:data dst))))
+
-(define (test-io-signature-1)
+(test-group "test-io-signature-1"
(let ((ios1 (gr:io-signature 1 2 8))
(ios2 (gr:io-signature2 1 2 16 32))
(ios3 (gr:io-signature3 1 -1 14 32 48))
@@ -122,12 +126,5 @@
(test-equal '#(1 2 3) (gr:sizeof-stream-items iosv))
))
-
-
-(test-begin "qa_0000_basics")
-(test-connect-1)
-(test-connect-2)
-(test-connect-3)
-(test-connect-4)
-(test-io-signature-1)
+;; Must follow all tests
(test-end "qa_0000_basics")