From 464a4cb099d681bbc744623209850e53f68ac41a Mon Sep 17 00:00:00 2001 From: Bernd Jendrissek Date: Wed, 21 Feb 2018 11:04:56 +0200 Subject: [PATCH] Benchmark current behaviour of (calculate-new-attrib-bounds). --- gnetlist/tests/libgeda/Makefile.am | 1 + .../libgeda/calculate-new-attrib-bounds.expected | 92 ++++++++++++++++++++++ .../tests/libgeda/calculate-new-attrib-bounds.scm | 25 ++++++ gnetlist/tests/libgeda/scm-args | 1 + 4 files changed, 119 insertions(+) create mode 100644 gnetlist/tests/libgeda/calculate-new-attrib-bounds.expected create mode 100644 gnetlist/tests/libgeda/calculate-new-attrib-bounds.scm diff --git a/gnetlist/tests/libgeda/Makefile.am b/gnetlist/tests/libgeda/Makefile.am index b6a8d7306..9259c6ed0 100644 --- a/gnetlist/tests/libgeda/Makefile.am +++ b/gnetlist/tests/libgeda/Makefile.am @@ -3,5 +3,6 @@ TEST_EXTENSIONS = .scm SCM_LOG_COMPILER = ./scmtest TESTS = \ + calculate-new-attrib-bounds.scm \ get-object-bounds.scm \ hierarchy-traverse-pages.scm diff --git a/gnetlist/tests/libgeda/calculate-new-attrib-bounds.expected b/gnetlist/tests/libgeda/calculate-new-attrib-bounds.expected new file mode 100644 index 000000000..ffb82e6ec --- /dev/null +++ b/gnetlist/tests/libgeda/calculate-new-attrib-bounds.expected @@ -0,0 +1,92 @@ +# + # + ((0 . 0) 0 . 0) + ((0 . 0) 0 . 0) + ((0 . 0) 0 . 0) + ((0 . 0) 0 . 0) + ((0 . 0) 0 . 0) + ((0 . 0) 0 . 0) + ((0 . 0) 0 . 0) + ((0 . 0) 0 . 0) + ((0 . 0) 0 . 0) + ((0 . 0) 0 . 0) + ((0 . 0) 0 . 0) + ((0 . 0) 0 . 0) + # + ((0 . 0) 0 . 0) + ((0 . 0) 0 . 0) + ((0 . 0) 0 . 0) + ((0 . 0) 0 . 0) + ((0 . 0) 0 . 0) + ((0 . 0) 0 . 0) + ((0 . 0) 0 . 0) + ((0 . 0) 0 . 0) + ((0 . 0) 0 . 0) + ((0 . 0) 0 . 0) + ((0 . 0) 0 . 0) + ((0 . 0) 0 . 0) + # + ((0 . 0) 0 . 0) + ((0 . 0) 0 . 0) + ((0 . 0) 0 . 0) + ((0 . 0) 0 . 0) + ((0 . 0) 0 . 0) + ((0 . 0) 0 . 0) + ((0 . 0) 0 . 0) + ((0 . 0) 0 . 0) + ((0 . 0) 0 . 0) + ((0 . 0) 0 . 0) + ((0 . 0) 0 . 0) + ((0 . 0) 0 . 0) + # + ((0 . 0) 0 . 0) + ((0 . 0) 0 . 0) + ((0 . 0) 0 . 0) + ((0 . 0) 0 . 0) + ((0 . 0) 0 . 0) + ((0 . 0) 0 . 0) + ((0 . 0) 0 . 0) + ((0 . 0) 0 . 0) + ((0 . 0) 0 . 0) + ((0 . 0) 0 . 0) + ((0 . 0) 0 . 0) + ((0 . 0) 0 . 0) + # + ((44100 . 44305) 47495 . 47630) + ((44100 . 44305) 47430 . 47565) + ((44100 . 44305) 47365 . 47500) + ((43982 . 44187) 47495 . 47630) + ((43982 . 44187) 47430 . 47565) + ((43982 . 44187) 47365 . 47500) + ((43865 . 44070) 47495 . 47630) + ((43865 . 44070) 47430 . 47565) + ((43865 . 44070) 47365 . 47500) + ((44035 . 44170) 47382 . 47587) + ((39995 . 40130) 50030 . 50235) + ((43865 . 44070) 44995 . 45130) + # + ((44050 . 44120) 47095 . 47230) + ((44050 . 44120) 47030 . 47165) + ((44050 . 44120) 46965 . 47100) + ((44000 . 44070) 47095 . 47230) + ((44000 . 44070) 47030 . 47165) + ((44000 . 44070) 46965 . 47100) + ((43950 . 44020) 47095 . 47230) + ((43950 . 44020) 47030 . 47165) + ((43950 . 44020) 46965 . 47100) + ((43985 . 44120) 47050 . 47120) + ((39995 . 40130) 50030 . 50100) + ((43950 . 44020) 44995 . 45130) + # + ((0 . 0) 0 . 0) + ((0 . 0) 0 . 0) + ((0 . 0) 0 . 0) + ((0 . 0) 0 . 0) + ((0 . 0) 0 . 0) + ((0 . 0) 0 . 0) + ((0 . 0) 0 . 0) + ((0 . 0) 0 . 0) + ((0 . 0) 0 . 0) + ((0 . 0) 0 . 0) + ((0 . 0) 0 . 0) + ((0 . 0) 0 . 0) diff --git a/gnetlist/tests/libgeda/calculate-new-attrib-bounds.scm b/gnetlist/tests/libgeda/calculate-new-attrib-bounds.scm new file mode 100644 index 000000000..2d71b8a30 --- /dev/null +++ b/gnetlist/tests/libgeda/calculate-new-attrib-bounds.scm @@ -0,0 +1,25 @@ +(use-modules (ice-9 format)) +(let* ((pages (hierarchy-traverse-pages (gnetlist:get-toplevel) 1)) + (component? (lambda (o) (equal? (get-object-type o) OBJ_COMPLEX))) + (components (map (lambda (o) (list o (get-object-attributes o))) + (filter component? (get-objects-in-page (car pages)))))) + (format #t "~{~{~s\n~{~{ ~s\n~{ ~s\n~}~}~}~}~}" + (map (lambda (o) + (list (car o) + (map (lambda (a) + (list a + (list (calculate-new-attrib-bounds a "Lower Left" -1 -1 -1) + (calculate-new-attrib-bounds a "Middle Left" -1 -1 -1) + (calculate-new-attrib-bounds a "Upper Left" -1 -1 -1) + (calculate-new-attrib-bounds a "Lower Middle" -1 -1 -1) + (calculate-new-attrib-bounds a "Middle Middle" -1 -1 -1) + (calculate-new-attrib-bounds a "Upper Middle" -1 -1 -1) + (calculate-new-attrib-bounds a "Lower Right" -1 -1 -1) + (calculate-new-attrib-bounds a "Middle Right" -1 -1 -1) + (calculate-new-attrib-bounds a "Upper Right" -1 -1 -1) + (calculate-new-attrib-bounds a "Middle Middle" 90 -1 -1) + (calculate-new-attrib-bounds a "Lower Right" 270 40000 50000) + (calculate-new-attrib-bounds a "Upper Left" 180 -1 45000) + ))) + (cadr o)))) + components))) diff --git a/gnetlist/tests/libgeda/scm-args b/gnetlist/tests/libgeda/scm-args index cd2e7f0a7..2eb4b940d 100644 --- a/gnetlist/tests/libgeda/scm-args +++ b/gnetlist/tests/libgeda/scm-args @@ -1,2 +1,3 @@ +calculate-new-attrib-bounds:$srcdir/unpromoted.sch hierarchy-traverse-pages:$srcdir/../../../examples/gTAG/gTAG.sch get-object-bounds:$srcdir/unpromoted.sch -- 2.11.4.GIT