poke-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v2 2/2] testsuite: Use `pktest` to test pickles and std


From: Mohammad-Reza Nabipoor
Subject: [PATCH v2 2/2] testsuite: Use `pktest` to test pickles and std
Date: Wed, 16 Dec 2020 07:30:21 +0330

2020-12-16  Mohammad-Reza Nabipoor  <m.nabipoor@yahoo.com>

        * configure.ac (AC_CONFIG_FILES): Add new makefiles.
        * testsuite/lib/poke.exp (simple_verified_host_execute): Add new proc.
        * testsuite/run-pktests.in: New file.
        * testsuite/poke.std/Makefile.am: Likewise.
        * testsuite/poke.pickles/Makefile.am: Likewise.
        * testsuite/poke.pickles/pickles.exp: Likewise.
        * testsuite/poke.pickles/argp-test.pk: New unit test.
        * testsuite/poke.pickles/color-test.pk: Likewise.
        * testsuite/poke.pickles/id3v1-test.pk: Likewise.
        * testsuite/poke.pickles/rgb24-test.pk: Likewise.
        * testsuite/poke.std/std-test.pk: Likewise.
        * testsuite/poke.std/std.exp: Re-write to use new test script.
        * testsuite/poke.argp/: Remove test directory.
        * testsuite/poke.color/: Likewise.
        * testsuite/poke.id3v1/: Likewise.
        * testsuite/poke.rgb24/: Likewise.
        * testsuite/Makefile.am (EXTRA_DIST): Add new tests, remove old ones.
        (SUBDIRS): Add `poke.pickles` and `poke.std`.
---

Hi, Jose!

The `testsuite/run-pktests.in` file is the test driver that translates
the TAP output to something understandable by DejaGNU.
I think this approach is simpler:
  - no need for manual work when adding new tests
  - still have one testing framework (the sh*tty DejaGNU :)) instead of two

I also added the missing `argp-diag-*` tests.


Cheers,
Mohammad-Reza


 ChangeLog                            |  21 ++
 configure.ac                         |   4 +-
 testsuite/Makefile.am                |  75 +-------
 testsuite/lib/poke.exp               |  99 ++++++++++
 testsuite/poke.argp/argp-1.pk        |  19 --
 testsuite/poke.argp/argp-10.pk       |  30 ---
 testsuite/poke.argp/argp-11.pk       |  30 ---
 testsuite/poke.argp/argp-12.pk       |  30 ---
 testsuite/poke.argp/argp-2.pk        |  20 --
 testsuite/poke.argp/argp-3.pk        |  20 --
 testsuite/poke.argp/argp-4.pk        |  20 --
 testsuite/poke.argp/argp-5.pk        |  30 ---
 testsuite/poke.argp/argp-6.pk        |  30 ---
 testsuite/poke.argp/argp-7.pk        |  29 ---
 testsuite/poke.argp/argp-8.pk        |  29 ---
 testsuite/poke.argp/argp-9.pk        |  29 ---
 testsuite/poke.argp/argp-diag-1.pk   |  25 ---
 testsuite/poke.argp/argp-diag-2.pk   |  25 ---
 testsuite/poke.argp/argp-diag-3.pk   |  25 ---
 testsuite/poke.argp/argp-diag-4.pk   |  25 ---
 testsuite/poke.argp/argp.exp         |  22 ---
 testsuite/poke.color/color-1.pk      |   6 -
 testsuite/poke.color/color-2.pk      |   6 -
 testsuite/poke.color/color-3.pk      |   7 -
 testsuite/poke.color/color-4.pk      |   6 -
 testsuite/poke.color/color.exp       |  22 ---
 testsuite/poke.id3v1/id3v1-1.pk      |   8 -
 testsuite/poke.id3v1/id3v1-2.pk      |   8 -
 testsuite/poke.id3v1/id3v1-3.pk      |   8 -
 testsuite/poke.id3v1/id3v1-4.pk      |   8 -
 testsuite/poke.id3v1/id3v1-5.pk      |   8 -
 testsuite/poke.id3v1/id3v1-6.pk      |  11 --
 testsuite/poke.id3v1/id3v1-7.pk      |   8 -
 testsuite/poke.id3v1/id3v1-8.pk      |  10 -
 testsuite/poke.id3v1/id3v1-9.pk      |  10 -
 testsuite/poke.id3v1/id3v1.exp       |  22 ---
 testsuite/poke.pickles/Makefile.am   |  28 +++
 testsuite/poke.pickles/argp-test.pk  | 274 +++++++++++++++++++++++++++
 testsuite/poke.pickles/color-test.pk |  56 ++++++
 testsuite/poke.pickles/id3v1-test.pk |  85 +++++++++
 testsuite/poke.pickles/pickles.exp   |   6 +
 testsuite/poke.pickles/rgb24-test.pk |  34 ++++
 testsuite/poke.rgb24/rgb24-1.pk      |   6 -
 testsuite/poke.rgb24/rgb24.exp       |  22 ---
 testsuite/poke.std/Makefile.am       |  28 +++
 testsuite/poke.std/atoi-1.pk         |   5 -
 testsuite/poke.std/atoi-10.pk        |   5 -
 testsuite/poke.std/atoi-11.pk        |   5 -
 testsuite/poke.std/atoi-12.pk        |   5 -
 testsuite/poke.std/atoi-13.pk        |   5 -
 testsuite/poke.std/atoi-14.pk        |   5 -
 testsuite/poke.std/atoi-2.pk         |   5 -
 testsuite/poke.std/atoi-3.pk         |   5 -
 testsuite/poke.std/atoi-4.pk         |   5 -
 testsuite/poke.std/atoi-5.pk         |   5 -
 testsuite/poke.std/atoi-6.pk         |   5 -
 testsuite/poke.std/atoi-7.pk         |   5 -
 testsuite/poke.std/atoi-8.pk         |   5 -
 testsuite/poke.std/atoi-9.pk         |   5 -
 testsuite/poke.std/catos-1.pk        |   4 -
 testsuite/poke.std/catos-2.pk        |   4 -
 testsuite/poke.std/catos-3.pk        |   4 -
 testsuite/poke.std/crc32.pk          |   5 -
 testsuite/poke.std/ltrim-1.pk        |   4 -
 testsuite/poke.std/ltrim-2.pk        |   4 -
 testsuite/poke.std/ltrim-3.pk        |   4 -
 testsuite/poke.std/qsort.pk          |  28 ---
 testsuite/poke.std/rtrim-1.pk        |   4 -
 testsuite/poke.std/rtrim-2.pk        |   4 -
 testsuite/poke.std/rtrim-3.pk        |   4 -
 testsuite/poke.std/std-test.pk       | 193 +++++++++++++++++++
 testsuite/poke.std/std.exp           |  26 +--
 testsuite/poke.std/stoca-1.pk        |   7 -
 testsuite/poke.std/stoca-2.pk        |   7 -
 testsuite/poke.std/stoca-3.pk        |   7 -
 testsuite/poke.std/stoca-4.pk        |   6 -
 testsuite/poke.std/strchr-1.pk       |   5 -
 testsuite/poke.std/strchr-2.pk       |   5 -
 testsuite/poke.std/strchr-3.pk       |   5 -
 testsuite/run-pktests.in             |  37 ++++
 80 files changed, 877 insertions(+), 884 deletions(-)
 delete mode 100644 testsuite/poke.argp/argp-1.pk
 delete mode 100644 testsuite/poke.argp/argp-10.pk
 delete mode 100644 testsuite/poke.argp/argp-11.pk
 delete mode 100644 testsuite/poke.argp/argp-12.pk
 delete mode 100644 testsuite/poke.argp/argp-2.pk
 delete mode 100644 testsuite/poke.argp/argp-3.pk
 delete mode 100644 testsuite/poke.argp/argp-4.pk
 delete mode 100644 testsuite/poke.argp/argp-5.pk
 delete mode 100644 testsuite/poke.argp/argp-6.pk
 delete mode 100644 testsuite/poke.argp/argp-7.pk
 delete mode 100644 testsuite/poke.argp/argp-8.pk
 delete mode 100644 testsuite/poke.argp/argp-9.pk
 delete mode 100644 testsuite/poke.argp/argp-diag-1.pk
 delete mode 100644 testsuite/poke.argp/argp-diag-2.pk
 delete mode 100644 testsuite/poke.argp/argp-diag-3.pk
 delete mode 100644 testsuite/poke.argp/argp-diag-4.pk
 delete mode 100644 testsuite/poke.argp/argp.exp
 delete mode 100644 testsuite/poke.color/color-1.pk
 delete mode 100644 testsuite/poke.color/color-2.pk
 delete mode 100644 testsuite/poke.color/color-3.pk
 delete mode 100644 testsuite/poke.color/color-4.pk
 delete mode 100644 testsuite/poke.color/color.exp
 delete mode 100644 testsuite/poke.id3v1/id3v1-1.pk
 delete mode 100644 testsuite/poke.id3v1/id3v1-2.pk
 delete mode 100644 testsuite/poke.id3v1/id3v1-3.pk
 delete mode 100644 testsuite/poke.id3v1/id3v1-4.pk
 delete mode 100644 testsuite/poke.id3v1/id3v1-5.pk
 delete mode 100644 testsuite/poke.id3v1/id3v1-6.pk
 delete mode 100644 testsuite/poke.id3v1/id3v1-7.pk
 delete mode 100644 testsuite/poke.id3v1/id3v1-8.pk
 delete mode 100644 testsuite/poke.id3v1/id3v1-9.pk
 delete mode 100644 testsuite/poke.id3v1/id3v1.exp
 create mode 100644 testsuite/poke.pickles/Makefile.am
 create mode 100644 testsuite/poke.pickles/argp-test.pk
 create mode 100644 testsuite/poke.pickles/color-test.pk
 create mode 100644 testsuite/poke.pickles/id3v1-test.pk
 create mode 100644 testsuite/poke.pickles/pickles.exp
 create mode 100644 testsuite/poke.pickles/rgb24-test.pk
 delete mode 100644 testsuite/poke.rgb24/rgb24-1.pk
 delete mode 100644 testsuite/poke.rgb24/rgb24.exp
 create mode 100644 testsuite/poke.std/Makefile.am
 delete mode 100644 testsuite/poke.std/atoi-1.pk
 delete mode 100644 testsuite/poke.std/atoi-10.pk
 delete mode 100644 testsuite/poke.std/atoi-11.pk
 delete mode 100644 testsuite/poke.std/atoi-12.pk
 delete mode 100644 testsuite/poke.std/atoi-13.pk
 delete mode 100644 testsuite/poke.std/atoi-14.pk
 delete mode 100644 testsuite/poke.std/atoi-2.pk
 delete mode 100644 testsuite/poke.std/atoi-3.pk
 delete mode 100644 testsuite/poke.std/atoi-4.pk
 delete mode 100644 testsuite/poke.std/atoi-5.pk
 delete mode 100644 testsuite/poke.std/atoi-6.pk
 delete mode 100644 testsuite/poke.std/atoi-7.pk
 delete mode 100644 testsuite/poke.std/atoi-8.pk
 delete mode 100644 testsuite/poke.std/atoi-9.pk
 delete mode 100644 testsuite/poke.std/catos-1.pk
 delete mode 100644 testsuite/poke.std/catos-2.pk
 delete mode 100644 testsuite/poke.std/catos-3.pk
 delete mode 100644 testsuite/poke.std/crc32.pk
 delete mode 100644 testsuite/poke.std/ltrim-1.pk
 delete mode 100644 testsuite/poke.std/ltrim-2.pk
 delete mode 100644 testsuite/poke.std/ltrim-3.pk
 delete mode 100644 testsuite/poke.std/qsort.pk
 delete mode 100644 testsuite/poke.std/rtrim-1.pk
 delete mode 100644 testsuite/poke.std/rtrim-2.pk
 delete mode 100644 testsuite/poke.std/rtrim-3.pk
 create mode 100644 testsuite/poke.std/std-test.pk
 delete mode 100644 testsuite/poke.std/stoca-1.pk
 delete mode 100644 testsuite/poke.std/stoca-2.pk
 delete mode 100644 testsuite/poke.std/stoca-3.pk
 delete mode 100644 testsuite/poke.std/stoca-4.pk
 delete mode 100644 testsuite/poke.std/strchr-1.pk
 delete mode 100644 testsuite/poke.std/strchr-2.pk
 delete mode 100644 testsuite/poke.std/strchr-3.pk
 create mode 100644 testsuite/run-pktests.in

diff --git a/ChangeLog b/ChangeLog
index 9f55f5f6..11837457 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,24 @@
+2020-12-16  Mohammad-Reza Nabipoor  <m.nabipoor@yahoo.com>
+
+       * configure.ac (AC_CONFIG_FILES): Add new makefiles.
+       * testsuite/lib/poke.exp (simple_verified_host_execute): Add new proc.
+       * testsuite/run-pktests.in: New file.
+       * testsuite/poke.std/Makefile.am: Likewise.
+       * testsuite/poke.pickles/Makefile.am: Likewise.
+       * testsuite/poke.pickles/pickles.exp: Likewise.
+       * testsuite/poke.pickles/argp-test.pk: New unit test.
+       * testsuite/poke.pickles/color-test.pk: Likewise.
+       * testsuite/poke.pickles/id3v1-test.pk: Likewise.
+       * testsuite/poke.pickles/rgb24-test.pk: Likewise.
+       * testsuite/poke.std/std-test.pk: Likewise.
+       * testsuite/poke.std/std.exp: Re-write to use new test script.
+       * testsuite/poke.argp/: Remove test directory.
+       * testsuite/poke.color/: Likewise.
+       * testsuite/poke.id3v1/: Likewise.
+       * testsuite/poke.rgb24/: Likewise.
+       * testsuite/Makefile.am (EXTRA_DIST): Add new tests, remove old ones.
+       (SUBDIRS): Add `poke.pickles` and `poke.std`.
+
 2020-12-16  Mohammad-Reza Nabipoor  <m.nabipoor@yahoo.com>
 
        * pickles/pktest.pk: New file.
diff --git a/configure.ac b/configure.ac
index 752ff188..7be68ef2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -176,7 +176,9 @@ AC_CONFIG_FILES(Makefile
                 etc/Makefile
                 testsuite/Makefile
                 testsuite/poke.libpoke/Makefile
-                testsuite/poke.mi-json/Makefile)
+                testsuite/poke.mi-json/Makefile
+                testsuite/poke.pickles/Makefile
+                testsuite/poke.std/Makefile)
 AC_CONFIG_FILES([run],
                 [chmod +x,-w run])
 AC_OUTPUT
diff --git a/testsuite/Makefile.am b/testsuite/Makefile.am
index 950e2ecf..b2437fb3 100644
--- a/testsuite/Makefile.am
+++ b/testsuite/Makefile.am
@@ -39,30 +39,14 @@ check-DEJAGNU: site.exp
          exit 77; :;\
        fi
 
-SUBDIRS = poke.libpoke poke.mi-json
+SUBDIRS = poke.libpoke poke.mi-json poke.pickles poke.std
 
 EXTRA_DIST = \
+  run-pktests.in \
   config/default.exp \
   config/unix.exp \
   lib/poke-dg.exp \
   lib/poke.exp \
-  poke.argp/argp.exp \
-  poke.argp/argp-1.pk \
-  poke.argp/argp-10.pk \
-  poke.argp/argp-11.pk \
-  poke.argp/argp-12.pk \
-  poke.argp/argp-2.pk \
-  poke.argp/argp-3.pk \
-  poke.argp/argp-4.pk \
-  poke.argp/argp-5.pk \
-  poke.argp/argp-6.pk \
-  poke.argp/argp-7.pk \
-  poke.argp/argp-8.pk \
-  poke.argp/argp-9.pk \
-  poke.argp/argp-diag-1.pk \
-  poke.argp/argp-diag-2.pk \
-  poke.argp/argp-diag-3.pk \
-  poke.argp/argp-diag-4.pk \
   poke.cmd/cmd.exp \
   poke.cmd/copy-1.pk \
   poke.cmd/copy-2.pk \
@@ -111,21 +95,6 @@ EXTRA_DIST = \
   poke.cmd/set-oindent.pk \
   poke.cmd/set-omaps-1.pk \
   poke.cmd/set-omode.pk \
-  poke.color/color.exp \
-  poke.color/color-1.pk \
-  poke.color/color-2.pk \
-  poke.color/color-3.pk \
-  poke.color/color-4.pk \
-  poke.id3v1/id3v1.exp \
-  poke.id3v1/id3v1-1.pk \
-  poke.id3v1/id3v1-2.pk \
-  poke.id3v1/id3v1-3.pk \
-  poke.id3v1/id3v1-4.pk \
-  poke.id3v1/id3v1-5.pk \
-  poke.id3v1/id3v1-6.pk \
-  poke.id3v1/id3v1-7.pk \
-  poke.id3v1/id3v1-8.pk \
-  poke.id3v1/id3v1-9.pk \
   poke.map/map.exp \
   poke.map/ass-map-1.pk \
   poke.map/ass-map-2.pk \
@@ -503,6 +472,11 @@ EXTRA_DIST = \
   poke.map/valmap-struct-2.pk \
   poke.map/valmap-struct-3.pk \
   poke.map/valmap-struct-4.pk \
+  poke.pickles/pickles.exp \
+  poke.pickles/argp-test.pk \
+  poke.pickles/color-test.pk \
+  poke.pickles/id3v1-test.pk \
+  poke.pickles/rgb24-test.pk \
   poke.pkl/pkl.exp \
   poke.pkl/postincr-1.pk \
   poke.pkl/postincr-2.pk \
@@ -1815,41 +1789,8 @@ EXTRA_DIST = \
   poke.pktest/pktest-11.pk \
   poke.pktest/pktest-12.pk \
   poke.repl/repl.exp \
-  poke.rgb24/rgb24.exp \
-  poke.rgb24/rgb24-1.pk \
   poke.std/std.exp \
-  poke.std/atoi-1.pk \
-  poke.std/atoi-2.pk \
-  poke.std/atoi-3.pk \
-  poke.std/atoi-4.pk \
-  poke.std/atoi-5.pk \
-  poke.std/atoi-6.pk \
-  poke.std/atoi-7.pk \
-  poke.std/atoi-8.pk \
-  poke.std/atoi-9.pk \
-  poke.std/atoi-10.pk \
-  poke.std/atoi-11.pk \
-  poke.std/atoi-12.pk \
-  poke.std/atoi-13.pk \
-  poke.std/atoi-14.pk \
-  poke.std/catos-1.pk \
-  poke.std/catos-2.pk \
-  poke.std/catos-3.pk \
-  poke.std/crc32.pk \
-  poke.std/ltrim-1.pk \
-  poke.std/ltrim-2.pk \
-  poke.std/ltrim-3.pk \
-  poke.std/qsort.pk \
-  poke.std/rtrim-1.pk \
-  poke.std/rtrim-2.pk \
-  poke.std/rtrim-3.pk \
-  poke.std/stoca-1.pk \
-  poke.std/stoca-2.pk \
-  poke.std/stoca-3.pk \
-  poke.std/stoca-4.pk \
-  poke.std/strchr-1.pk \
-  poke.std/strchr-2.pk \
-  poke.std/strchr-3.pk \
+  poke.std/std-test.pk \
   poke.time/gettimeofday-1.pk \
   poke.time/time.exp \
   poke.time/time32.pk \
diff --git a/testsuite/lib/poke.exp b/testsuite/lib/poke.exp
index 9c3f2c5a..ea8444d3 100644
--- a/testsuite/lib/poke.exp
+++ b/testsuite/lib/poke.exp
@@ -270,3 +270,102 @@ proc verified_host_execute {args} {
     catch close
     return ""
 }
+
+# Simplified `verified_host_execute`
+# The output pattern is relaxed to accept anything on each line.
+# Only supports lines with {,X}PASSED, {,X}FAILED, UNTESTED, UNRESOLVED.
+
+proc simple_verified_host_execute {args} {
+    set timeoutmsg "Timed out: Never got started, "
+    set timeout 100
+    set file all
+    set timetol 0
+    set arguments ""
+
+    if { [llength $args] == 0} {
+        set executable $args
+    } else {
+        set executable [string trimleft [lindex [split $args " "] 0] "\{"]
+        set params [string trimleft [lindex [split $args " "] 1] "\{"]
+        set params [string trimright $params "\}"]
+    }
+
+    verbose "The executable is $executable" 2
+    if {![file exists ${executable}]} {
+        perror "The executable, \"$executable\" is missing" 0
+        return "No source file found"
+    }
+
+    # spawn the executable and look for the DejaGnu output messages from the
+    # test case.
+    # spawn -noecho -open [open "|./${executable}" "r"]
+    spawn -noecho "./${executable}" ${params}
+    set prefix "\[^\r\n\]*"
+    set txt "\[^\r\n\]*\r\n"
+    expect {
+        -re "^$prefix\tPASSED:${txt}" {
+            set output [string range $expect_out(0,string) 8 end]
+            pass "$output"
+            set timetol 0
+            exp_continue
+        }
+        -re "^$prefix\tXPASSED:${txt}" {
+            set output [string range $expect_out(0,string) 8 end]
+            xpass "$output"
+            set timetol 0
+            exp_continue
+        }
+        -re "^$prefix\tFAILED:${txt}" {
+            set output [string range $expect_out(0,string) 8 end]
+            fail "$output"
+            set timetol 0
+            exp_continue
+        }
+        -re "^$prefix\tXFAILED:${txt}" {
+            set output [string range $expect_out(0,string) 8 end]
+            xfail "$output"
+            set timetol 0
+            exp_continue
+        }
+        -re "^$prefix\tUNTESTED:${txt}" {
+            set output [string range $expect_out(0,string) 8 end]
+            untested "$output"
+            set timetol 0
+            exp_continue
+        }
+        -re "^$prefix\tUNRESOLVED:${txt}" {
+            set output [string range $expect_out(0,string) 8 end]
+            unresolved "$output"
+            set timetol 0
+            exp_continue
+        }
+        -re "^Totals" {
+            verbose "All done" 2
+        }
+        eof {
+            #       unresolved "${executable} died prematurely"
+            #       catch close
+            #       return "${executable} died prematurely"
+        }
+        timeout {
+            warning "Timed out executing test case"
+            if { $timetol <= 2 } {
+                incr timetol
+                exp_continue
+            } else {
+                catch close
+                return "Timed out executing test case"
+            }
+        }
+        -re "^$prefix\r\n" {
+            exp_continue
+        }
+    }
+
+    catch wait wres
+    verify_exit_status $executable $wres
+
+    # force a close of the executable to be safe.
+    catch close
+    return ""
+}
diff --git a/testsuite/poke.argp/argp-1.pk b/testsuite/poke.argp/argp-1.pk
deleted file mode 100644
index 83032a3c..00000000
--- a/testsuite/poke.argp/argp-1.pk
+++ /dev/null
@@ -1,19 +0,0 @@
-/* { dg-do run } */
-
-load argp;
-
-var args = ["foo", "-f", "bar"];
-
-var foo = "no";
-
-var options =
-    [Argp_Option {
-         name = "f",
-         handler = lambda (string arg) void: { foo = "yes"; }
-     }];
-
-/* { dg-command { var rest = argp_parse ("foo", "", "", options, args) } } */
-/* { dg-command { foo } } */
-/* { dg-output {"yes"} } */
-/* { dg-command { rest } } */
-/* { dg-output "\n\\\[\"foo\",\"bar\"\\\]" } */
diff --git a/testsuite/poke.argp/argp-10.pk b/testsuite/poke.argp/argp-10.pk
deleted file mode 100644
index 2dbebf8c..00000000
--- a/testsuite/poke.argp/argp-10.pk
+++ /dev/null
@@ -1,30 +0,0 @@
-/* { dg-do run } */
-
-load argp;
-
-var args = ["--bar=", "foo", "--foo"];
-
-var foo = "no";
-var bar = "";
-
-var options =
-    [Argp_Option {
-         name = "f",
-         long_name = "foo",
-         handler = lambda (string arg) void: { foo = "yes"; }
-       },
-     Argp_Option {
-         name = "b",
-         long_name = "bar",
-         arg_required = 1,
-         handler = lambda (string arg) void: { bar = arg; }
-       }
-    ];
-
-/* { dg-command { var rest = argp_parse ("foo", "", "", options, args) } } */
-/* { dg-command { foo } } */
-/* { dg-output {"yes"} } */
-/* { dg-command { bar } } */
-/* { dg-output "\n\"\"" } */
-/* { dg-command { rest } } */
-/* { dg-output "\n\\\[\"foo\"\\\]" } */
diff --git a/testsuite/poke.argp/argp-11.pk b/testsuite/poke.argp/argp-11.pk
deleted file mode 100644
index e1f7291a..00000000
--- a/testsuite/poke.argp/argp-11.pk
+++ /dev/null
@@ -1,30 +0,0 @@
-/* { dg-do run } */
-
-load argp;
-
-var args = ["--bar=", "foo", "--", "--foo"];
-
-var foo = "no";
-var bar = "";
-
-var options =
-    [Argp_Option {
-         name = "f",
-         long_name = "foo",
-         handler = lambda (string arg) void: { foo = "yes"; }
-       },
-     Argp_Option {
-         name = "b",
-         long_name = "bar",
-         arg_required = 1,
-         handler = lambda (string arg) void: { bar = arg; }
-       }
-    ];
-
-/* { dg-command { var rest = argp_parse ("foo", "", "", options, args) } } */
-/* { dg-command { foo } } */
-/* { dg-output {"no"} } */
-/* { dg-command { bar } } */
-/* { dg-output "\n\"\"" } */
-/* { dg-command { rest } } */
-/* { dg-output "\n\\\[\"foo\",\"--foo\"\\\]" } */
diff --git a/testsuite/poke.argp/argp-12.pk b/testsuite/poke.argp/argp-12.pk
deleted file mode 100644
index ab4535bc..00000000
--- a/testsuite/poke.argp/argp-12.pk
+++ /dev/null
@@ -1,30 +0,0 @@
-/* { dg-do run } */
-
-load argp;
-
-var args = ["--bar=", "foo", "--", "--foo", "--"];
-
-var foo = "no";
-var bar = "";
-
-var options =
-    [Argp_Option {
-         name = "f",
-         long_name = "foo",
-         handler = lambda (string arg) void: { foo = "yes"; }
-       },
-     Argp_Option {
-         name = "b",
-         long_name = "bar",
-         arg_required = 1,
-         handler = lambda (string arg) void: { bar = arg; }
-       }
-    ];
-
-/* { dg-command { var rest = argp_parse ("foo", "", "", options, args) } } */
-/* { dg-command { foo } } */
-/* { dg-output {"no"} } */
-/* { dg-command { bar } } */
-/* { dg-output "\n\"\"" } */
-/* { dg-command { rest } } */
-/* { dg-output "\n\\\[\"foo\",\"--foo\",\"--\"\\\]" } */
diff --git a/testsuite/poke.argp/argp-2.pk b/testsuite/poke.argp/argp-2.pk
deleted file mode 100644
index 230b5990..00000000
--- a/testsuite/poke.argp/argp-2.pk
+++ /dev/null
@@ -1,20 +0,0 @@
-/* { dg-do run } */
-
-load argp;
-
-var args = ["foo", "--foo", "bar"];
-
-var foo = "no";
-
-var options =
-    [Argp_Option {
-         name = "f",
-         long_name = "foo",
-         handler = lambda (string arg) void: { foo = "yes"; }
-     }];
-
-/* { dg-command { var rest = argp_parse ("foo", "", "", options, args) } } */
-/* { dg-command { foo } } */
-/* { dg-output {"yes"} } */
-/* { dg-command { rest } } */
-/* { dg-output "\n\\\[\"foo\",\"bar\"\\\]" } */
diff --git a/testsuite/poke.argp/argp-3.pk b/testsuite/poke.argp/argp-3.pk
deleted file mode 100644
index 9b577847..00000000
--- a/testsuite/poke.argp/argp-3.pk
+++ /dev/null
@@ -1,20 +0,0 @@
-/* { dg-do run } */
-
-load argp;
-
-var args = ["--foo", "bar", "foo"];
-
-var foo = "no";
-
-var options =
-    [Argp_Option {
-         name = "f",
-         long_name = "foo",
-         handler = lambda (string arg) void: { foo = "yes"; }
-     }];
-
-/* { dg-command { var rest = argp_parse ("foo", "", "", options, args) } } */
-/* { dg-command { foo } } */
-/* { dg-output {"yes"} } */
-/* { dg-command { rest } } */
-/* { dg-output "\n\\\[\"bar\",\"foo\"\\\]" } */
diff --git a/testsuite/poke.argp/argp-4.pk b/testsuite/poke.argp/argp-4.pk
deleted file mode 100644
index 03f54771..00000000
--- a/testsuite/poke.argp/argp-4.pk
+++ /dev/null
@@ -1,20 +0,0 @@
-/* { dg-do run } */
-
-load argp;
-
-var args = ["bar", "foo", "--foo"];
-
-var foo = "no";
-
-var options =
-    [Argp_Option {
-         name = "f",
-         long_name = "foo",
-         handler = lambda (string arg) void: { foo = "yes"; }
-     }];
-
-/* { dg-command { var rest = argp_parse ("foo", "", "", options, args) } } */
-/* { dg-command { foo } } */
-/* { dg-output {"yes"} } */
-/* { dg-command { rest } } */
-/* { dg-output "\n\\\[\"bar\",\"foo\"\\\]" } */
diff --git a/testsuite/poke.argp/argp-5.pk b/testsuite/poke.argp/argp-5.pk
deleted file mode 100644
index 796bcece..00000000
--- a/testsuite/poke.argp/argp-5.pk
+++ /dev/null
@@ -1,30 +0,0 @@
-/* { dg-do run } */
-
-load argp;
-
-var args = ["-b", "bar", "foo", "--foo"];
-
-var foo = "no";
-var bar = "";
-
-var options =
-    [Argp_Option {
-         name = "f",
-         long_name = "foo",
-         handler = lambda (string arg) void: { foo = "yes"; }
-       },
-     Argp_Option {
-         name = "b",
-         long_name = "bar",
-         arg_required = 1,
-         handler = lambda (string arg) void: { bar = arg; }
-       }
-    ];
-
-/* { dg-command { var rest = argp_parse ("foo", "", "", options, args) } } */
-/* { dg-command { foo } } */
-/* { dg-output {"yes"} } */
-/* { dg-command { bar } } */
-/* { dg-output "\n\"bar\"" } */
-/* { dg-command { rest } } */
-/* { dg-output "\n\\\[\"foo\"\\\]" } */
diff --git a/testsuite/poke.argp/argp-6.pk b/testsuite/poke.argp/argp-6.pk
deleted file mode 100644
index 9016fc3d..00000000
--- a/testsuite/poke.argp/argp-6.pk
+++ /dev/null
@@ -1,30 +0,0 @@
-/* { dg-do run } */
-
-load argp;
-
-var args = ["--bar=bar", "foo", "--foo"];
-
-var foo = "no";
-var bar = "";
-
-var options =
-    [Argp_Option {
-         name = "f",
-         long_name = "foo",
-         handler = lambda (string arg) void: { foo = "yes"; }
-       },
-     Argp_Option {
-         name = "b",
-         long_name = "bar",
-         arg_required = 1,
-         handler = lambda (string arg) void: { bar = arg; }
-       }
-    ];
-
-/* { dg-command { var rest = argp_parse ("foo", "", "", options, args) } } */
-/* { dg-command { foo } } */
-/* { dg-output {"yes"} } */
-/* { dg-command { bar } } */
-/* { dg-output "\n\"bar\"" } */
-/* { dg-command { rest } } */
-/* { dg-output "\n\\\[\"foo\"\\\]" } */
diff --git a/testsuite/poke.argp/argp-7.pk b/testsuite/poke.argp/argp-7.pk
deleted file mode 100644
index 649b78bd..00000000
--- a/testsuite/poke.argp/argp-7.pk
+++ /dev/null
@@ -1,29 +0,0 @@
-/* { dg-do run } */
-
-load argp;
-
-var args = ["foo", "-fb", "bar"];
-
-var foo = "no";
-var bar = "no";
-
-var options =
-    [Argp_Option {
-         name = "f",
-         long_name = "foo",
-         handler = lambda (string arg) void: { foo = "yes"; }
-       },
-     Argp_Option {
-         name = "b",
-         long_name = "bar",
-         handler = lambda (string arg) void: { bar = "yes"; }
-       }
-    ];
-
-/* { dg-command { var rest = argp_parse ("foo", "", "", options, args) } } */
-/* { dg-command { foo } } */
-/* { dg-output {"yes"} } */
-/* { dg-command { bar } } */
-/* { dg-output "\n\"yes\"" } */
-/* { dg-command { rest } } */
-/* { dg-output "\n\\\[\"foo\",\"bar\"\\\]" } */
diff --git a/testsuite/poke.argp/argp-8.pk b/testsuite/poke.argp/argp-8.pk
deleted file mode 100644
index 91792f1c..00000000
--- a/testsuite/poke.argp/argp-8.pk
+++ /dev/null
@@ -1,29 +0,0 @@
-/* { dg-do run } */
-
-load argp;
-
-var args = ["foo", "-bf", "bar"];
-
-var foo = "no";
-var bar = "no";
-
-var options =
-    [Argp_Option {
-         name = "f",
-         long_name = "foo",
-         handler = lambda (string arg) void: { foo = "yes"; }
-       },
-     Argp_Option {
-         name = "b",
-         long_name = "bar",
-         handler = lambda (string arg) void: { bar = "yes"; }
-       }
-    ];
-
-/* { dg-command { var rest = argp_parse ("foo", "", "", options, args) } } */
-/* { dg-command { foo } } */
-/* { dg-output {"yes"} } */
-/* { dg-command { bar } } */
-/* { dg-output "\n\"yes\"" } */
-/* { dg-command { rest } } */
-/* { dg-output "\n\\\[\"foo\",\"bar\"\\\]" } */
diff --git a/testsuite/poke.argp/argp-9.pk b/testsuite/poke.argp/argp-9.pk
deleted file mode 100644
index 5daf74aa..00000000
--- a/testsuite/poke.argp/argp-9.pk
+++ /dev/null
@@ -1,29 +0,0 @@
-/* { dg-do run } */
-
-load argp;
-
-var args = ["foo", "-b", "bar"];
-
-var foo = "no";
-var bar = "no";
-
-var options =
-    [Argp_Option {
-         name = "f",
-         long_name = "foo",
-         handler = lambda (string arg) void: { foo = "yes"; }
-       },
-     Argp_Option {
-         name = "b",
-         long_name = "bar",
-         handler = lambda (string arg) void: { bar = "yes"; }
-       }
-    ];
-
-/* { dg-command { var rest = argp_parse ("foo", "", "", options, args) } } */
-/* { dg-command { foo } } */
-/* { dg-output {"no"} } */
-/* { dg-command { bar } } */
-/* { dg-output "\n\"yes\"" } */
-/* { dg-command { rest } } */
-/* { dg-output "\n\\\[\"foo\",\"bar\"\\\]" } */
diff --git a/testsuite/poke.argp/argp-diag-1.pk 
b/testsuite/poke.argp/argp-diag-1.pk
deleted file mode 100644
index b467f8a4..00000000
--- a/testsuite/poke.argp/argp-diag-1.pk
+++ /dev/null
@@ -1,25 +0,0 @@
-/* { dg-do run } */
-
-load argp;
-
-var args = ["foo", "-b", "-f"];
-
-var foo = "no";
-var bar = "no";
-
-var options =
-    [Argp_Option {
-         name = "f",
-         long_name = "foo",
-         handler = lambda (string arg) void: { foo = "yes"; }
-       },
-     Argp_Option {
-         name = "b",
-         long_name = "bar",
-         arg_required = 1,
-         handler = lambda (string arg) void: { bar = "yes"; }
-       }
-    ];
-
-/* { dg-command { try argp_parse ("foo", "", "", options, args); catch if 
E_inval { print "caught\n"; } } } */
-/* { dg-output "caught" } */
diff --git a/testsuite/poke.argp/argp-diag-2.pk 
b/testsuite/poke.argp/argp-diag-2.pk
deleted file mode 100644
index ddd6702b..00000000
--- a/testsuite/poke.argp/argp-diag-2.pk
+++ /dev/null
@@ -1,25 +0,0 @@
-/* { dg-do run } */
-
-load argp;
-
-var args = ["foo", "--bar", "-f"];
-
-var foo = "no";
-var bar = "no";
-
-var options =
-    [Argp_Option {
-         name = "f",
-         long_name = "foo",
-         handler = lambda (string arg) void: { foo = "yes"; }
-       },
-     Argp_Option {
-         name = "b",
-         long_name = "bar",
-         arg_required = 1,
-         handler = lambda (string arg) void: { bar = "yes"; }
-       }
-    ];
-
-/* { dg-command { try argp_parse ("foo", "", "", options, args); catch if 
E_inval { print "caught\n"; } } } */
-/* { dg-output "caught" } */
diff --git a/testsuite/poke.argp/argp-diag-3.pk 
b/testsuite/poke.argp/argp-diag-3.pk
deleted file mode 100644
index 2948e632..00000000
--- a/testsuite/poke.argp/argp-diag-3.pk
+++ /dev/null
@@ -1,25 +0,0 @@
-/* { dg-do run } */
-
-load argp;
-
-var args = ["foo", "--xxx", "-f"];
-
-var foo = "no";
-var bar = "no";
-
-var options =
-    [Argp_Option {
-         name = "f",
-         long_name = "foo",
-         handler = lambda (string arg) void: { foo = "yes"; }
-       },
-     Argp_Option {
-         name = "b",
-         long_name = "bar",
-         arg_required = 1,
-         handler = lambda (string arg) void: { bar = "yes"; }
-       }
-    ];
-
-/* { dg-command { try argp_parse ("foo", "", "", options, args); catch if 
E_generic { print "caught\n"; } } } */
-/* { dg-output "caught" } */
diff --git a/testsuite/poke.argp/argp-diag-4.pk 
b/testsuite/poke.argp/argp-diag-4.pk
deleted file mode 100644
index b17bff49..00000000
--- a/testsuite/poke.argp/argp-diag-4.pk
+++ /dev/null
@@ -1,25 +0,0 @@
-/* { dg-do run } */
-
-load argp;
-
-var args = ["--foo=lala", "-f"];
-
-var foo = "no";
-var bar = "no";
-
-var options =
-    [Argp_Option {
-         name = "f",
-         long_name = "foo",
-         handler = lambda (string arg) void: { foo = "yes"; }
-       },
-     Argp_Option {
-         name = "b",
-         long_name = "bar",
-         arg_required = 1,
-         handler = lambda (string arg) void: { bar = "yes"; }
-       }
-    ];
-
-/* { dg-command { try argp_parse ("foo", "", "", options, args); catch if 
E_inval { print "caught\n"; } } } */
-/* { dg-output "caught" } */
diff --git a/testsuite/poke.argp/argp.exp b/testsuite/poke.argp/argp.exp
deleted file mode 100644
index 1557071c..00000000
--- a/testsuite/poke.argp/argp.exp
+++ /dev/null
@@ -1,22 +0,0 @@
-# argp.exp - Tests for teh argp pickle
-#
-#   Copyright (C) 2020 Jose E. Marchesi
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, 
USA.
-
-load_lib ${tool}-dg.exp
-dg-init
-dg-runtest [lsort [glob -nocomplain $srcdir/poke.argp/*.pk]] {} {}
-dg-finish
diff --git a/testsuite/poke.color/color-1.pk b/testsuite/poke.color/color-1.pk
deleted file mode 100644
index 8793f6e4..00000000
--- a/testsuite/poke.color/color-1.pk
+++ /dev/null
@@ -1,6 +0,0 @@
-/* { dg-do run } */
-
-load color;
-
-/* { dg-command "color_white" } */
-/* { dg-output "0" } */
diff --git a/testsuite/poke.color/color-2.pk b/testsuite/poke.color/color-2.pk
deleted file mode 100644
index 55038e7d..00000000
--- a/testsuite/poke.color/color-2.pk
+++ /dev/null
@@ -1,6 +0,0 @@
-/* { dg-do run } */
-
-load color;
-
-/* { dg-command "color_name (color_tomato)" } */
-/* { dg-output {"tomato"} } */
diff --git a/testsuite/poke.color/color-3.pk b/testsuite/poke.color/color-3.pk
deleted file mode 100644
index a907f1a0..00000000
--- a/testsuite/poke.color/color-3.pk
+++ /dev/null
@@ -1,7 +0,0 @@
-/* { dg-do run } */
-
-load color;
-
-/* { dg-command "var my_color = color_register" } */
-/* { dg-command "color_name (my_color)" } */
-/* { dg-output {"user-defined color"} } */
diff --git a/testsuite/poke.color/color-4.pk b/testsuite/poke.color/color-4.pk
deleted file mode 100644
index b5e08853..00000000
--- a/testsuite/poke.color/color-4.pk
+++ /dev/null
@@ -1,6 +0,0 @@
-/* { dg-do run } */
-
-load color;
-
-/* { dg-command { try color_name (color_num_colors); catch if E_out_of_bounds 
{ print "caught\n"; } } } */
-/* { dg-output {caught} } */
diff --git a/testsuite/poke.color/color.exp b/testsuite/poke.color/color.exp
deleted file mode 100644
index 87970fea..00000000
--- a/testsuite/poke.color/color.exp
+++ /dev/null
@@ -1,22 +0,0 @@
-# color.exp - Testsuite for the `color' pickle.
-#
-#   Copyright (C) 2020 Jose E. Marchesi
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, 
USA.
-
-load_lib ${tool}-dg.exp
-dg-init
-dg-runtest [lsort [glob -nocomplain $srcdir/poke.color/*.pk]] {} {}
-dg-finish
diff --git a/testsuite/poke.id3v1/id3v1-1.pk b/testsuite/poke.id3v1/id3v1-1.pk
deleted file mode 100644
index 5a3b1c92..00000000
--- a/testsuite/poke.id3v1/id3v1-1.pk
+++ /dev/null
@@ -1,8 +0,0 @@
-/* { dg-do run } */
-/* { dg-data {c*} {0x54 0x41 0x47 0x30 0x31 0x20 0x2d 0x20  0x45 0x63 0x6c 
0x69 0x70 0x73 0x65 0x20  0x44 0x65 0x20 0x4d 0x61 0x72 0x20 0x20  0x20 0x20 
0x20 0x20 0x20 0x20 0x20 0x20  0x20 0x4a 0x6f 0x61 0x71 0x75 0x69 0x6e  0x20 
0x53 0x61 0x62 0x69 0x6e 0x61 0x20  0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20  
0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x4d  0x65 0x6e 0x74 0x69 0x72 0x61 0x73 
0x20  0x50 0x69 0x61 0x64 0x6f 0x73 0x61 0x73  0x20 0x20 0x20 0x20 0x20 0x20 
0x20 0x20  0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20  0x20 0x76 0x65 0x72 0x79 
0x20 0x67 0x6f  0x6f 0x64 0x20 0x73 0x6f 0x6e 0x67 0x20  0x20 0x20 0x20 0x20 
0x20 0x20 0x20 0x20  0x20 0x20 0x20 0x20 0x20 0x00 0x01 0x11} } */
-
-load id3v1;
-
-/* { dg-command { var tag = ID3V1_Tag @ 0#B } } */
-/* { dg-command { tag.id == ['T','A','G'] } } */
-/* { dg-output "1" } */
diff --git a/testsuite/poke.id3v1/id3v1-2.pk b/testsuite/poke.id3v1/id3v1-2.pk
deleted file mode 100644
index 0da8bd3c..00000000
--- a/testsuite/poke.id3v1/id3v1-2.pk
+++ /dev/null
@@ -1,8 +0,0 @@
-/* { dg-do run } */
-/* { dg-data {c*} {0x54 0x41 0x47 0x30 0x31 0x20 0x2d 0x20  0x45 0x63 0x6c 
0x69 0x70 0x73 0x65 0x20  0x44 0x65 0x20 0x4d 0x61 0x72 0x20 0x20  0x20 0x20 
0x20 0x20 0x20 0x20 0x20 0x20  0x20 0x4a 0x6f 0x61 0x71 0x75 0x69 0x6e  0x20 
0x53 0x61 0x62 0x69 0x6e 0x61 0x20  0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20  
0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x4d  0x65 0x6e 0x74 0x69 0x72 0x61 0x73 
0x20  0x50 0x69 0x61 0x64 0x6f 0x73 0x61 0x73  0x20 0x20 0x20 0x20 0x20 0x20 
0x20 0x20  0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20  0x20 0x76 0x65 0x72 0x79 
0x20 0x67 0x6f  0x6f 0x64 0x20 0x73 0x6f 0x6e 0x67 0x20  0x20 0x20 0x20 0x20 
0x20 0x20 0x20 0x20  0x20 0x20 0x20 0x20 0x20 0x00 0x01 0x11} } */
-
-load id3v1;
-
-/* { dg-command { var tag = ID3V1_Tag @ 0#B } } */
-/* { dg-command { tag.get_title } } */
-/* { dg-output {"01 - Eclipse De Mar"} } */
diff --git a/testsuite/poke.id3v1/id3v1-3.pk b/testsuite/poke.id3v1/id3v1-3.pk
deleted file mode 100644
index 1ac255eb..00000000
--- a/testsuite/poke.id3v1/id3v1-3.pk
+++ /dev/null
@@ -1,8 +0,0 @@
-/* { dg-do run } */
-/* { dg-data {c*} {0x54 0x41 0x47 0x30 0x31 0x20 0x2d 0x20  0x45 0x63 0x6c 
0x69 0x70 0x73 0x65 0x20  0x44 0x65 0x20 0x4d 0x61 0x72 0x20 0x20  0x20 0x20 
0x20 0x20 0x20 0x20 0x20 0x20  0x20 0x4a 0x6f 0x61 0x71 0x75 0x69 0x6e  0x20 
0x53 0x61 0x62 0x69 0x6e 0x61 0x20  0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20  
0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x4d  0x65 0x6e 0x74 0x69 0x72 0x61 0x73 
0x20  0x50 0x69 0x61 0x64 0x6f 0x73 0x61 0x73  0x20 0x20 0x20 0x20 0x20 0x20 
0x20 0x20  0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20  0x20 0x76 0x65 0x72 0x79 
0x20 0x67 0x6f  0x6f 0x64 0x20 0x73 0x6f 0x6e 0x67 0x20  0x20 0x20 0x20 0x20 
0x20 0x20 0x20 0x20  0x20 0x20 0x20 0x20 0x20 0x00 0x01 0x11} } */
-
-load id3v1;
-
-/* { dg-command { var tag = ID3V1_Tag @ 0#B } } */
-/* { dg-command { tag.get_artist } } */
-/* { dg-output {"Joaquin Sabina"} } */
diff --git a/testsuite/poke.id3v1/id3v1-4.pk b/testsuite/poke.id3v1/id3v1-4.pk
deleted file mode 100644
index 5ce72cb4..00000000
--- a/testsuite/poke.id3v1/id3v1-4.pk
+++ /dev/null
@@ -1,8 +0,0 @@
-/* { dg-do run } */
-/* { dg-data {c*} {0x54 0x41 0x47 0x30 0x31 0x20 0x2d 0x20  0x45 0x63 0x6c 
0x69 0x70 0x73 0x65 0x20  0x44 0x65 0x20 0x4d 0x61 0x72 0x20 0x20  0x20 0x20 
0x20 0x20 0x20 0x20 0x20 0x20  0x20 0x4a 0x6f 0x61 0x71 0x75 0x69 0x6e  0x20 
0x53 0x61 0x62 0x69 0x6e 0x61 0x20  0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20  
0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x4d  0x65 0x6e 0x74 0x69 0x72 0x61 0x73 
0x20  0x50 0x69 0x61 0x64 0x6f 0x73 0x61 0x73  0x20 0x20 0x20 0x20 0x20 0x20 
0x20 0x20  0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20  0x20 0x76 0x65 0x72 0x79 
0x20 0x67 0x6f  0x6f 0x64 0x20 0x73 0x6f 0x6e 0x67 0x20  0x20 0x20 0x20 0x20 
0x20 0x20 0x20 0x20  0x20 0x20 0x20 0x20 0x20 0x00 0x01 0x11} } */
-
-load id3v1;
-
-/* { dg-command { var tag = ID3V1_Tag @ 0#B } } */
-/* { dg-command { tag.get_album } } */
-/* { dg-output {"Mentiras Piadosas"} } */
diff --git a/testsuite/poke.id3v1/id3v1-5.pk b/testsuite/poke.id3v1/id3v1-5.pk
deleted file mode 100644
index dee72f41..00000000
--- a/testsuite/poke.id3v1/id3v1-5.pk
+++ /dev/null
@@ -1,8 +0,0 @@
-/* { dg-do run } */
-/* { dg-data {c*} {0x54 0x41 0x47 0x30 0x31 0x20 0x2d 0x20  0x45 0x63 0x6c 
0x69 0x70 0x73 0x65 0x20  0x44 0x65 0x20 0x4d 0x61 0x72 0x20 0x20  0x20 0x20 
0x20 0x20 0x20 0x20 0x20 0x20  0x20 0x4a 0x6f 0x61 0x71 0x75 0x69 0x6e  0x20 
0x53 0x61 0x62 0x69 0x6e 0x61 0x20  0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20  
0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x4d  0x65 0x6e 0x74 0x69 0x72 0x61 0x73 
0x20  0x50 0x69 0x61 0x64 0x6f 0x73 0x61 0x73  0x20 0x20 0x20 0x20 0x20 0x20 
0x20 0x20  0x20 0x20 0x20 0x20 0x20 0x31 0x39 0x38  0x30 0x76 0x65 0x72 0x79 
0x20 0x67 0x6f  0x6f 0x64 0x20 0x73 0x6f 0x6e 0x67 0x20  0x20 0x20 0x20 0x20 
0x20 0x20 0x20 0x20  0x20 0x20 0x20 0x20 0x20 0x00 0x01 0x11} } */
-
-load id3v1;
-
-/* { dg-command { var tag = ID3V1_Tag @ 0#B } } */
-/* { dg-command { tag.get_year } } */
-/* { dg-output "1980" } */
diff --git a/testsuite/poke.id3v1/id3v1-6.pk b/testsuite/poke.id3v1/id3v1-6.pk
deleted file mode 100644
index 59b98126..00000000
--- a/testsuite/poke.id3v1/id3v1-6.pk
+++ /dev/null
@@ -1,11 +0,0 @@
-/* { dg-do run } */
-/* { dg-data {c*} {0x54 0x41 0x47 0x30 0x31 0x20 0x2d 0x20  0x45 0x63 0x6c 
0x69 0x70 0x73 0x65 0x20  0x44 0x65 0x20 0x4d 0x61 0x72 0x20 0x20  0x20 0x20 
0x20 0x20 0x20 0x20 0x20 0x20  0x20 0x4a 0x6f 0x61 0x71 0x75 0x69 0x6e  0x20 
0x53 0x61 0x62 0x69 0x6e 0x61 0x20  0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20  
0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x4d  0x65 0x6e 0x74 0x69 0x72 0x61 0x73 
0x20  0x50 0x69 0x61 0x64 0x6f 0x73 0x61 0x73  0x20 0x20 0x20 0x20 0x20 0x20 
0x20 0x20  0x20 0x20 0x20 0x20 0x20 0x31 0x39 0x38  0x30 0x76 0x65 0x72 0x79 
0x20 0x67 0x6f  0x6f 0x64 0x20 0x73 0x6f 0x6e 0x67 0x20  0x20 0x20 0x20 0x20 
0x20 0x20 0x20 0x20  0x20 0x20 0x20 0x20 0x20 0x00 0x01 0x11} } */
-
-load id3v1;
-
-/* { dg-command { var tag = ID3V1_Tag @ 0#B } } */
-/* { dg-command { tag.get_genre } } */
-/* { dg-output {"rock"} } */
-/* { dg-command { tag.set_genre ("eurodance") } } */
-/* { dg-command { tag.get_genre } } */
-/* { dg-output "\n\"eurodance\"" } */
diff --git a/testsuite/poke.id3v1/id3v1-7.pk b/testsuite/poke.id3v1/id3v1-7.pk
deleted file mode 100644
index 99d09cec..00000000
--- a/testsuite/poke.id3v1/id3v1-7.pk
+++ /dev/null
@@ -1,8 +0,0 @@
-/* { dg-do run } */
-/* { dg-data {c*} {0x54 0x41 0x47 0x30 0x31 0x20 0x2d 0x20  0x45 0x63 0x6c 
0x69 0x70 0x73 0x65 0x20  0x44 0x65 0x20 0x4d 0x61 0x72 0x20 0x20  0x20 0x20 
0x20 0x20 0x20 0x20 0x20 0x20  0x20 0x4a 0x6f 0x61 0x71 0x75 0x69 0x6e  0x20 
0x53 0x61 0x62 0x69 0x6e 0x61 0x20  0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20  
0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x4d  0x65 0x6e 0x74 0x69 0x72 0x61 0x73 
0x20  0x50 0x69 0x61 0x64 0x6f 0x73 0x61 0x73  0x20 0x20 0x20 0x20 0x20 0x20 
0x20 0x20  0x20 0x20 0x20 0x20 0x20 0x31 0x39 0x38  0x30 0x76 0x65 0x72 0x79 
0x20 0x67 0x6f  0x6f 0x64 0x20 0x73 0x6f 0x6e 0x67 0x20  0x20 0x20 0x20 0x20 
0x20 0x20 0x20 0x20  0x20 0x20 0x20 0x20 0x20 0x00 0x01 0x11} } */
-
-load id3v1;
-
-/* { dg-command { var tag = ID3V1_Tag @ 0#B } } */
-/* { dg-command { tag.get_comment } } */
-/* { dg-output {"very good song"} } */
diff --git a/testsuite/poke.id3v1/id3v1-8.pk b/testsuite/poke.id3v1/id3v1-8.pk
deleted file mode 100644
index 7c48d16b..00000000
--- a/testsuite/poke.id3v1/id3v1-8.pk
+++ /dev/null
@@ -1,10 +0,0 @@
-/* { dg-do run } */
-/* { dg-data {c*} {0x54 0x41 0x47 0x30 0x31 0x20 0x2d 0x20  0x45 0x63 0x6c 
0x69 0x70 0x73 0x65 0x20  0x44 0x65 0x20 0x4d 0x61 0x72 0x20 0x20  0x20 0x20 
0x20 0x20 0x20 0x20 0x20 0x20  0x20 0x4a 0x6f 0x61 0x71 0x75 0x69 0x6e  0x20 
0x53 0x61 0x62 0x69 0x6e 0x61 0x20  0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20  
0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x4d  0x65 0x6e 0x74 0x69 0x72 0x61 0x73 
0x20  0x50 0x69 0x61 0x64 0x6f 0x73 0x61 0x73  0x20 0x20 0x20 0x20 0x20 0x20 
0x20 0x20  0x20 0x20 0x20 0x20 0x20 0x31 0x39 0x38  0x30 0x76 0x65 0x72 0x79 
0x20 0x67 0x6f  0x6f 0x64 0x20 0x73 0x6f 0x6e 0x67 0x20  0x20 0x20 0x20 0x20 
0x20 0x20 0x20 0x20  0x20 0x20 0x20 0x20 0x20 0x00 0x01 0x11} } */
-
-load id3v1;
-
-/* { dg-command { var tag = ID3V1_Tag @ 0#B } } */
-/* { dg-command { tag.set_title ("Pickle") } } */
-/* { dg-command { dump :ascii 0 :ruler 0 :from tag.title'offset :size 30#B } } 
*/
-/* { dg-output   "00000003: 5069 636b 6c65 2020 2020 2020 2020 2020" } */
-/* { dg-output "\n00000013: 2020 2020 2020 2020 2020 2020 2020
diff --git a/testsuite/poke.id3v1/id3v1-9.pk b/testsuite/poke.id3v1/id3v1-9.pk
deleted file mode 100644
index acba2b98..00000000
--- a/testsuite/poke.id3v1/id3v1-9.pk
+++ /dev/null
@@ -1,10 +0,0 @@
-/* { dg-do run } */
-/* { dg-data {c*} {0x54 0x41 0x47 0x30 0x31 0x20 0x2d 0x20  0x45 0x63 0x6c 
0x69 0x70 0x73 0x65 0x20  0x44 0x65 0x20 0x4d 0x61 0x72 0x20 0x20  0x20 0x20 
0x20 0x20 0x20 0x20 0x20 0x20  0x20 0x4a 0x6f 0x61 0x71 0x75 0x69 0x6e  0x20 
0x53 0x61 0x62 0x69 0x6e 0x61 0x20  0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20  
0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x4d  0x65 0x6e 0x74 0x69 0x72 0x61 0x73 
0x20  0x50 0x69 0x61 0x64 0x6f 0x73 0x61 0x73  0x20 0x20 0x20 0x20 0x20 0x20 
0x20 0x20  0x20 0x20 0x20 0x20 0x20 0x31 0x39 0x38  0x30 0x76 0x65 0x72 0x79 
0x20 0x67 0x6f  0x6f 0x64 0x20 0x73 0x6f 0x6e 0x67 0x20  0x20 0x20 0x20 0x20 
0x20 0x20 0x20 0x20  0x20 0x20 0x20 0x20 0x20 0x00 0x01 0x11} } */
-
-load id3v1;
-
-/* { dg-command { var tag = ID3V1_Tag @ 0#B } } */
-/* { dg-command { tag.set_artist ("RMS") } } */
-/* { dg-command { dump :ascii 0 :ruler 0 :from tag.artist'offset :size 30#B } 
} */
-/* { dg-output   "00000021: 524d 5320 2020 2020 2020 2020 2020 2020" } */
-/* { dg-output "\n00000031: 2020 2020 2020 2020 2020 2020 2020
diff --git a/testsuite/poke.id3v1/id3v1.exp b/testsuite/poke.id3v1/id3v1.exp
deleted file mode 100644
index fa4f248f..00000000
--- a/testsuite/poke.id3v1/id3v1.exp
+++ /dev/null
@@ -1,22 +0,0 @@
-# color.exp - Testsuite for the `id3v1' pickle.
-#
-#   Copyright (C) 2020 Jose E. Marchesi
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, 
USA.
-
-load_lib ${tool}-dg.exp
-dg-init
-dg-runtest [lsort [glob -nocomplain $srcdir/poke.id3v1/*.pk]] {} {}
-dg-finish
diff --git a/testsuite/poke.pickles/Makefile.am 
b/testsuite/poke.pickles/Makefile.am
new file mode 100644
index 00000000..48814ce5
--- /dev/null
+++ b/testsuite/poke.pickles/Makefile.am
@@ -0,0 +1,28 @@
+# Copyright (C) 2020 The poke authors
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+AUTOMAKE_OPTIONS = subdir-objects
+
+CLEANFILES = run-pktests-pickles
+check_PROGRAMS = run-pktests-pickles
+
+do_subst = \
+  sed -e 's,[@]abs_top_builddir[@],$(abs_top_builddir),g' \
+      -e 's,[@]abs_top_srcdir[@],$(abs_top_srcdir),g'     \
+      -e 's,[@]test_component[@],pickles,g'
+
+run-pktests-pickles: ../run-pktests.in Makefile
+       $(do_subst) < $(srcdir)/../run-pktests.in > run-pktests-pickles
+       chmod +x run-pktests-pickles
diff --git a/testsuite/poke.pickles/argp-test.pk 
b/testsuite/poke.pickles/argp-test.pk
new file mode 100644
index 00000000..91d03954
--- /dev/null
+++ b/testsuite/poke.pickles/argp-test.pk
@@ -0,0 +1,274 @@
+
+/* Copyright (C) 2020 The poke authors */
+
+/* This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+load pktest;
+load argp;
+
+var tests = [
+  PkTest {
+    name = "short option",
+    func = lambda (string name) void:
+      {
+        var args = ["foo", "-f", "bar"];
+        var foo = "no";
+        var options =
+            [Argp_Option {
+                 name = "f",
+                 handler = lambda (string arg) void: { foo = "yes"; }
+             }];
+        var rest = argp_parse ("foo", "", "", options, args);
+
+        assert (foo == "yes");
+        assert (rest == ["foo", "bar"]);
+      },
+  },
+  PkTest {
+    name = "long option",
+    func = lambda (string name) void:
+      {
+        var foo = "no";
+        var options =
+            [Argp_Option {
+                 name = "f",
+                 long_name = "foo",
+                 handler = lambda (string arg) void: { foo = "yes"; }
+             }];
+        var rest = argp_parse ("foo", "", "", options, ["foo", "--foo", 
"bar"]);
+
+        assert (foo == "yes");
+        assert (rest == ["foo", "bar"]);
+
+        foo = "no";
+        rest = argp_parse ("foo", "", "", options, ["--foo", "foo", "bar"]);
+        assert (foo == "yes");
+        assert (rest == ["foo", "bar"]);
+      },
+  },
+  PkTest {
+    name = "option with required argument",
+    func = lambda (string name) void:
+      {
+        var foo = "no";
+        var bar = "";
+        var options =
+            [Argp_Option {
+                 name = "f",
+                 long_name = "foo",
+                 handler = lambda (string arg) void: { foo = "yes"; }
+               },
+             Argp_Option {
+                 name = "b",
+                 long_name = "bar",
+                 arg_required = 1,
+                 handler = lambda (string arg) void: { bar = arg; }
+               }
+            ];
+        var rest = argp_parse ("foo", "", "", options,
+                               ["-b", "bar", "foo", "--foo"]);
+
+        assert (foo == "yes");
+        assert (bar == "bar");
+        assert (rest == ["foo"]);
+
+        foo = "";
+        bar = "";
+        rest = argp_parse ("foo", "", "", options,
+                           ["--bar=bar", "foo", "--foo"]);
+        assert (foo == "yes");
+        assert (bar == "bar");
+        assert (rest == ["foo"]);
+
+        foo = "no";
+        bar = "no";
+        rest = argp_parse ("foo", "", "", options,
+                           ["--bar=", "foo", "--foo"]);
+        assert (foo == "yes");
+        assert (bar == "");
+        assert (rest == ["foo"]);
+      },
+  },
+  PkTest {
+    name = "short options grouped by a single hyphen",
+    func = lambda (string name) void:
+      {
+        var foo = "no";
+        var bar = "no";
+        var options =
+            [Argp_Option {
+                 name = "f",
+                 long_name = "foo",
+                 handler = lambda (string arg) void: { foo = "yes"; }
+               },
+             Argp_Option {
+                 name = "b",
+                 long_name = "bar",
+                 handler = lambda (string arg) void: { bar = "yes"; }
+               }
+            ];
+        var rest = argp_parse ("foo", "", "", options, ["foo", "-fb", "bar"]);
+
+        assert (foo == "yes");
+        assert (bar == "yes");
+        assert (rest == ["foo", "bar"]);
+
+        foo = "";
+        bar = "";
+        rest = argp_parse ("foo", "", "", options, ["foo", "-bf", "bar"]);
+        assert (foo == "yes");
+        assert (bar == "yes");
+        assert (rest == ["foo", "bar"]);
+
+        foo = "no";
+        bar = "no";
+        rest = argp_parse ("foo", "", "", options, ["foo", "-b", "bar"]);
+        assert (foo == "no");
+        assert (bar == "yes");
+        assert (rest == ["foo", "bar"]);
+      },
+  },
+  PkTest {
+    name = "mark end of options with '--'",
+    func = lambda (string name) void:
+      {
+        var foo = "no";
+        var bar = "foobar";
+        var options =
+            [Argp_Option {
+                 name = "f",
+                 long_name = "foo",
+                 handler = lambda (string arg) void: { foo = "yes"; }
+               },
+             Argp_Option {
+                 name = "b",
+                 long_name = "bar",
+                 arg_required = 1,
+                 handler = lambda (string arg) void: { bar = arg; }
+               }
+            ];
+        var rest = argp_parse ("foo", "", "", options,
+                               ["--bar=", "foo", "--", "--foo"]);
+
+        assert (foo == "no");
+        assert (bar == "");
+        assert (rest == ["foo", "--foo"]);
+
+        foo = "yes";
+        bar = "foobar";
+        rest = argp_parse ("foo", "", "", options,
+                               ["--bar=", "foo", "--", "--foo", "--"]);
+
+        assert (foo == "yes");
+        assert (bar == "");
+        assert (rest == ["foo", "--foo", "--"]);
+      },
+  },
+  PkTest {
+    name = "unknown option",
+    func = lambda (string name) void:
+      {
+        var foo = "no";
+        var bar = "no";
+        var options =
+            [Argp_Option {
+                 name = "f",
+                 long_name = "foo",
+                 handler = lambda (string arg) void: { foo = "yes"; }
+               },
+             Argp_Option {
+                 name = "b",
+                 long_name = "bar",
+                 arg_required = 1,
+                 handler = lambda (string arg) void: { bar = "yes"; }
+               }
+            ];
+
+        try
+          {
+            argp_parse ("foo", "", "", options, ["foo", "--xxx", "-f"]);
+            assert(0, "unreachable reached!");
+          }
+        catch if E_generic
+          {
+            assert(1, "expected exception");
+          }
+      },
+  },
+  PkTest {
+    name = "missing required argument",
+    func = lambda (string name) void:
+      {
+        var foo = "no";
+        var bar = "no";
+        var options =
+            [Argp_Option {
+                 name = "f",
+                 long_name = "foo",
+                 handler = lambda (string arg) void: { foo = "yes"; }
+               },
+             Argp_Option {
+                 name = "b",
+                 long_name = "bar",
+                 arg_required = 1,
+                 handler = lambda (string arg) void: { bar = "yes"; }
+               }
+            ];
+
+        try
+          {
+            argp_parse ("foo", "", "", options, ["foo", "--bar", "-f"]);
+            assert(0, "unreachable reached!");
+          }
+        catch if E_inval
+          {
+            assert(1, "expected exception");
+          }
+      },
+  },
+  PkTest {
+    name = "unexpected argument for option",
+    func = lambda (string name) void:
+      {
+        var foo = "no";
+        var bar = "no";
+        var options =
+            [Argp_Option {
+                 name = "f",
+                 long_name = "foo",
+                 handler = lambda (string arg) void: { foo = "yes"; }
+               },
+             Argp_Option {
+                 name = "b",
+                 long_name = "bar",
+                 arg_required = 1,
+                 handler = lambda (string arg) void: { bar = "yes"; }
+               }
+            ];
+
+        try
+          {
+            argp_parse ("foo", "", "", options, ["--foo=lala", "-f"]);
+            assert(0, "unreachable reached!");
+          }
+        catch if E_inval
+          {
+            assert(1, "expected exception");
+          }
+      },
+  },
+];
+
+pktest_run (tests);
diff --git a/testsuite/poke.pickles/color-test.pk 
b/testsuite/poke.pickles/color-test.pk
new file mode 100644
index 00000000..7c6e6d3c
--- /dev/null
+++ b/testsuite/poke.pickles/color-test.pk
@@ -0,0 +1,56 @@
+
+/* Copyright (C) 2020 The poke authors */
+
+/* This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+load pktest;
+load color;
+
+var tests = [
+  PkTest {
+    name = "colors",
+    func = lambda (string name) void:
+      {
+        assert (color_white == 0);
+        assert (color_name (color_tomato) == "tomato");
+      },
+  },
+  PkTest {
+    name = "registeration",
+    func = lambda (string name) void:
+      {
+        var my_color = color_register;
+
+        assert (color_name (my_color) == "user-defined color");
+      },
+  },
+  PkTest {
+    name = "color_name length",
+    func = lambda (string name) void:
+      {
+        try
+          {
+            color_name (color_num_colors);
+            assert (0, "unreachable reached!");
+          }
+        catch if E_out_of_bounds
+          {
+            assert (1, "incorrect length for `color_name` array");
+          }
+      },
+  },
+];
+
+pktest_run (tests);
diff --git a/testsuite/poke.pickles/id3v1-test.pk 
b/testsuite/poke.pickles/id3v1-test.pk
new file mode 100644
index 00000000..a6d2ae87
--- /dev/null
+++ b/testsuite/poke.pickles/id3v1-test.pk
@@ -0,0 +1,85 @@
+
+/* Copyright (C) 2020 The poke authors */
+
+/* This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+load pktest;
+load id3v1;
+
+var data = open ("*data*");
+
+uint<8>[128] @ data : 0#B = [
+  0x54UB, 0x41UB, 0x47UB, 0x30UB, 0x31UB, 0x20UB, 0x2dUB, 0x20UB, 0x45UB,
+  0x63UB, 0x6cUB, 0x69UB, 0x70UB, 0x73UB, 0x65UB, 0x20UB, 0x44UB, 0x65UB,
+  0x20UB, 0x4dUB, 0x61UB, 0x72UB, 0x20UB, 0x20UB, 0x20UB, 0x20UB, 0x20UB,
+  0x20UB, 0x20UB, 0x20UB, 0x20UB, 0x20UB, 0x20UB, 0x4aUB, 0x6fUB, 0x61UB,
+  0x71UB, 0x75UB, 0x69UB, 0x6eUB, 0x20UB, 0x53UB, 0x61UB, 0x62UB, 0x69UB,
+  0x6eUB, 0x61UB, 0x20UB, 0x20UB, 0x20UB, 0x20UB, 0x20UB, 0x20UB, 0x20UB,
+  0x20UB, 0x20UB, 0x20UB, 0x20UB, 0x20UB, 0x20UB, 0x20UB, 0x20UB, 0x20UB,
+  0x4dUB, 0x65UB, 0x6eUB, 0x74UB, 0x69UB, 0x72UB, 0x61UB, 0x73UB, 0x20UB,
+  0x50UB, 0x69UB, 0x61UB, 0x64UB, 0x6fUB, 0x73UB, 0x61UB, 0x73UB, 0x20UB,
+  0x20UB, 0x20UB, 0x20UB, 0x20UB, 0x20UB, 0x20UB, 0x20UB, 0x20UB, 0x20UB,
+  0x20UB, 0x20UB, 0x20UB, 0x31UB, 0x39UB, 0x38UB, 0x30UB, 0x76UB, 0x65UB,
+  0x72UB, 0x79UB, 0x20UB, 0x67UB, 0x6fUB, 0x6fUB, 0x64UB, 0x20UB, 0x73UB,
+  0x6fUB, 0x6eUB, 0x67UB, 0x20UB, 0x20UB, 0x20UB, 0x20UB, 0x20UB, 0x20UB,
+  0x20UB, 0x20UB, 0x20UB, 0x20UB, 0x20UB, 0x20UB, 0x20UB, 0x20UB, 0x00UB,
+  0x01UB, 0x11UB
+];
+
+var tests = [
+  PkTest {
+    name = "retrieve info",
+    func = lambda (string name) void:
+      {
+        var tag = ID3V1_Tag @ data : 0#B;
+
+        assert (tag.id == ['T','A','G']);
+        assert (tag.get_title == "01 - Eclipse De Mar");
+        assert (tag.get_artist == "Joaquin Sabina");
+        assert (tag.get_album == "Mentiras Piadosas");
+        assert (tag.get_year == 1980);
+        assert (tag.get_genre == "rock");
+        assert (tag.get_comment == "very good song");
+      },
+  },
+  PkTest {
+    name = "change info",
+    func = lambda (string name) void:
+      {
+        var tag = ID3V1_Tag @ data : 0#B;
+
+        assert (tag.get_genre == "rock");
+        tag.set_genre ("eurodance");
+        assert (tag.get_genre == "eurodance");
+
+        assert (tag.get_title == "01 - Eclipse De Mar");
+        tag.set_title ("Pickle");
+        assert (tag.get_title == "Pickle");
+        assert (tag.title'size == 30#B);
+        assert ((uint<8>[tag.title'size] @ data : tag.title'offset) ==
+                [0x50UB, 0x69UB, 0x63UB, 0x6bUB, 0x6cUB, 0x65UB, .[29]=' ']);
+
+        assert (tag.get_artist == "Joaquin Sabina");
+        tag.set_artist ("RMS");
+        assert (tag.artist'size == 30#B);
+        assert ((uint<8>[tag.artist'size] @ data : tag.artist'offset) ==
+                [0x52UB, 0x4dUB, 0x53UB, .[29]=' ']);
+      },
+  },
+];
+var ok = pktest_run_noexit (tests);
+
+close (data);
+exit (ok ? 0 : 1);
diff --git a/testsuite/poke.pickles/pickles.exp 
b/testsuite/poke.pickles/pickles.exp
new file mode 100644
index 00000000..8c88279b
--- /dev/null
+++ b/testsuite/poke.pickles/pickles.exp
@@ -0,0 +1,6 @@
+
+load_lib "poke.exp"
+
+if { [simple_verified_host_execute "poke.pickles/run-pktests-pickles"] ne "" } 
{
+    fail "testing pickles failed"
+}
diff --git a/testsuite/poke.pickles/rgb24-test.pk 
b/testsuite/poke.pickles/rgb24-test.pk
new file mode 100644
index 00000000..c79f0389
--- /dev/null
+++ b/testsuite/poke.pickles/rgb24-test.pk
@@ -0,0 +1,34 @@
+
+/* Copyright (C) 2020 The poke authors */
+
+/* This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+load pktest;
+load rgb24;
+
+var tests = [
+  PkTest {
+    name = "rgb24_color",
+    func = lambda (string name) void:
+      {
+        assert (rgb24_color'length == color_num_colors);
+        assert (rgb24_color[color_tomato] == [255UB,99UB,71UB]);
+        assert (rgb24_color[color_red] == [255UB,0UB,0UB]);
+        assert (rgb24_color[color_blue] == [0UB,0UB,255UB]);
+      },
+  },
+];
+
+pktest_run (tests);
diff --git a/testsuite/poke.rgb24/rgb24-1.pk b/testsuite/poke.rgb24/rgb24-1.pk
deleted file mode 100644
index b95bad5b..00000000
--- a/testsuite/poke.rgb24/rgb24-1.pk
+++ /dev/null
@@ -1,6 +0,0 @@
-/* { dg-do run } */
-
-load rgb24;
-
-/* { dg-command {rgb24_color[color_tomato]} } */
-/* { dg-output "\\\[255UB,99UB,71UB\\\]" } */
diff --git a/testsuite/poke.rgb24/rgb24.exp b/testsuite/poke.rgb24/rgb24.exp
deleted file mode 100644
index f44617c2..00000000
--- a/testsuite/poke.rgb24/rgb24.exp
+++ /dev/null
@@ -1,22 +0,0 @@
-# rgb24.exp - Testsuite for the `rgb24' pickle.
-#
-#   Copyright (C) 2020 Jose E. Marchesi
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, 
USA.
-
-load_lib ${tool}-dg.exp
-dg-init
-dg-runtest [lsort [glob -nocomplain $srcdir/poke.rgb24/*.pk]] {} {}
-dg-finish
diff --git a/testsuite/poke.std/Makefile.am b/testsuite/poke.std/Makefile.am
new file mode 100644
index 00000000..b52a1860
--- /dev/null
+++ b/testsuite/poke.std/Makefile.am
@@ -0,0 +1,28 @@
+# Copyright (C) 2020 The poke authors
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+AUTOMAKE_OPTIONS = subdir-objects
+
+CLEANFILES = run-pktests-std
+check_PROGRAMS = run-pktests-std
+
+do_subst = \
+  sed -e 's,[@]abs_top_builddir[@],$(abs_top_builddir),g' \
+      -e 's,[@]abs_top_srcdir[@],$(abs_top_srcdir),g'     \
+      -e 's,[@]test_component[@],std,g'
+
+run-pktests-std: ../run-pktests.in Makefile
+       $(do_subst) < $(srcdir)/../run-pktests.in > run-pktests-std
+       chmod +x run-pktests-std
diff --git a/testsuite/poke.std/atoi-1.pk b/testsuite/poke.std/atoi-1.pk
deleted file mode 100644
index 37ad8c98..00000000
--- a/testsuite/poke.std/atoi-1.pk
+++ /dev/null
@@ -1,5 +0,0 @@
-/* { dg-do run } */
-
-/* { dg-command { .set obase 10 } } */
-/* { dg-command { atoi("0", 2) } } */
-/* { dg-output "0L" } */
diff --git a/testsuite/poke.std/atoi-10.pk b/testsuite/poke.std/atoi-10.pk
deleted file mode 100644
index 8e8e7eca..00000000
--- a/testsuite/poke.std/atoi-10.pk
+++ /dev/null
@@ -1,5 +0,0 @@
-/* { dg-do run } */
-
-/* { dg-command { .set obase 10 } } */
-/* { dg-command { atoi("1777") } } */
-/* { dg-output "1777L" } */
diff --git a/testsuite/poke.std/atoi-11.pk b/testsuite/poke.std/atoi-11.pk
deleted file mode 100644
index 19c3a625..00000000
--- a/testsuite/poke.std/atoi-11.pk
+++ /dev/null
@@ -1,5 +0,0 @@
-/* { dg-do run } */
-
-/* { dg-command { .set obase 10 } } */
-/* { dg-command { atoi("fce2", 16) } } */
-/* { dg-output "64738L" } */
diff --git a/testsuite/poke.std/atoi-12.pk b/testsuite/poke.std/atoi-12.pk
deleted file mode 100644
index e68db7c2..00000000
--- a/testsuite/poke.std/atoi-12.pk
+++ /dev/null
@@ -1,5 +0,0 @@
-/* { dg-do run } */
-
-/* { dg-command { .set obase 10 } } */
-/* { dg-command { atoi("bEeF", 16) } } */
-/* { dg-output "48879L" } */
diff --git a/testsuite/poke.std/atoi-13.pk b/testsuite/poke.std/atoi-13.pk
deleted file mode 100644
index 8d64d050..00000000
--- a/testsuite/poke.std/atoi-13.pk
+++ /dev/null
@@ -1,5 +0,0 @@
-/* { dg-do run } */
-
-/* { dg-command { .set obase 10 } } */
-/* { dg-command { atoi("deadbeef", 16) } } */
-/* { dg-output "-559038737L" } */
diff --git a/testsuite/poke.std/atoi-14.pk b/testsuite/poke.std/atoi-14.pk
deleted file mode 100644
index 8d6495d3..00000000
--- a/testsuite/poke.std/atoi-14.pk
+++ /dev/null
@@ -1,5 +0,0 @@
-/* { dg-do run } */
-
-/* { dg-command { .set obase 10 } } */
-/* { dg-command { try atoi("deadbeef", 88); catch if E_inval { print 
"caught\n"; } } } */
-/* { dg-output "caught" } */
diff --git a/testsuite/poke.std/atoi-2.pk b/testsuite/poke.std/atoi-2.pk
deleted file mode 100644
index bcb94776..00000000
--- a/testsuite/poke.std/atoi-2.pk
+++ /dev/null
@@ -1,5 +0,0 @@
-/* { dg-do run } */
-
-/* { dg-command { .set obase 10 } } */
-/* { dg-command { atoi("1", 2) } } */
-/* { dg-output "1L" } */
diff --git a/testsuite/poke.std/atoi-3.pk b/testsuite/poke.std/atoi-3.pk
deleted file mode 100644
index 58035bd8..00000000
--- a/testsuite/poke.std/atoi-3.pk
+++ /dev/null
@@ -1,5 +0,0 @@
-/* { dg-do run } */
-
-/* { dg-command { .set obase 10 } } */
-/* { dg-command { atoi("01010101", 2) } } */
-/* { dg-output "85L" } */
diff --git a/testsuite/poke.std/atoi-4.pk b/testsuite/poke.std/atoi-4.pk
deleted file mode 100644
index 2e0f627e..00000000
--- a/testsuite/poke.std/atoi-4.pk
+++ /dev/null
@@ -1,5 +0,0 @@
-/* { dg-do run } */
-
-/* { dg-command { .set obase 10 } } */
-/* { dg-command { atoi("111111111", 2) } } */
-/* { dg-output "511L" } */
diff --git a/testsuite/poke.std/atoi-5.pk b/testsuite/poke.std/atoi-5.pk
deleted file mode 100644
index 79c081bb..00000000
--- a/testsuite/poke.std/atoi-5.pk
+++ /dev/null
@@ -1,5 +0,0 @@
-/* { dg-do run } */
-
-/* { dg-command { .set obase 10 } } */
-/* { dg-command { atoi("x", 2) } } */
-/* { dg-output "0L" } */
diff --git a/testsuite/poke.std/atoi-6.pk b/testsuite/poke.std/atoi-6.pk
deleted file mode 100644
index 3dbc682b..00000000
--- a/testsuite/poke.std/atoi-6.pk
+++ /dev/null
@@ -1,5 +0,0 @@
-/* { dg-do run } */
-
-/* { dg-command { .set obase 10 } } */
-/* { dg-command { atoi("1111x234", 2) } } */
-/* { dg-output "15L" } */
diff --git a/testsuite/poke.std/atoi-7.pk b/testsuite/poke.std/atoi-7.pk
deleted file mode 100644
index 73168ea5..00000000
--- a/testsuite/poke.std/atoi-7.pk
+++ /dev/null
@@ -1,5 +0,0 @@
-/* { dg-do run } */
-
-/* { dg-command { .set obase 10 } } */
-/* { dg-command { try atoi("1234", 3); catch if E_generic { print("pass"); } } 
} */
-/* { dg-output "pass" } */
diff --git a/testsuite/poke.std/atoi-8.pk b/testsuite/poke.std/atoi-8.pk
deleted file mode 100644
index 6ffe08c8..00000000
--- a/testsuite/poke.std/atoi-8.pk
+++ /dev/null
@@ -1,5 +0,0 @@
-/* { dg-do run } */
-
-/* { dg-command { .set obase 10 } } */
-/* { dg-command { atoi("1777", 8) } } */
-/* { dg-output "1023L" } */
diff --git a/testsuite/poke.std/atoi-9.pk b/testsuite/poke.std/atoi-9.pk
deleted file mode 100644
index 4f00e58d..00000000
--- a/testsuite/poke.std/atoi-9.pk
+++ /dev/null
@@ -1,5 +0,0 @@
-/* { dg-do run } */
-
-/* { dg-command { .set obase 10 } } */
-/* { dg-command { atoi("1777", 10) } } */
-/* { dg-output "1777L" } */
diff --git a/testsuite/poke.std/catos-1.pk b/testsuite/poke.std/catos-1.pk
deleted file mode 100644
index 5935e83c..00000000
--- a/testsuite/poke.std/catos-1.pk
+++ /dev/null
@@ -1,4 +0,0 @@
-/* { dg-do run } */
-
-/* { dg-command { catos (['a','b','c']) } } */
-/* { dg-output "\"abc\"" } */
diff --git a/testsuite/poke.std/catos-2.pk b/testsuite/poke.std/catos-2.pk
deleted file mode 100644
index d47fb0c6..00000000
--- a/testsuite/poke.std/catos-2.pk
+++ /dev/null
@@ -1,4 +0,0 @@
-/* { dg-do run } */
-
-/* { dg-command { catos (['\0']) } } */
-/* { dg-output "\"\"" } */
diff --git a/testsuite/poke.std/catos-3.pk b/testsuite/poke.std/catos-3.pk
deleted file mode 100644
index 4c9c8a37..00000000
--- a/testsuite/poke.std/catos-3.pk
+++ /dev/null
@@ -1,4 +0,0 @@
-/* { dg-do run } */
-
-/* { dg-command { catos (['a','\0','b']) } } */
-/* { dg-output "\"a\"" } */
diff --git a/testsuite/poke.std/crc32.pk b/testsuite/poke.std/crc32.pk
deleted file mode 100644
index fabc70a4..00000000
--- a/testsuite/poke.std/crc32.pk
+++ /dev/null
@@ -1,5 +0,0 @@
-/* { dg-do run } */
-
-/* { dg-command { .set obase 16 } } */
-/* { dg-command { crc32([0x01UB, 0x02UB, 0x03UB, 0x04UB, 0x05UB, 0x06UB, 
0x07UB, 0x08UB]) } } */
-/* { dg-output "0x3fca88c5U" } */
diff --git a/testsuite/poke.std/ltrim-1.pk b/testsuite/poke.std/ltrim-1.pk
deleted file mode 100644
index 1a08c0a9..00000000
--- a/testsuite/poke.std/ltrim-1.pk
+++ /dev/null
@@ -1,4 +0,0 @@
-/* { dg-do run } */
-
-/* { dg-command { ltrim ("  a string to trim  ") } } */
-/* { dg-output "a string to trim  " } */
diff --git a/testsuite/poke.std/ltrim-2.pk b/testsuite/poke.std/ltrim-2.pk
deleted file mode 100644
index 25452573..00000000
--- a/testsuite/poke.std/ltrim-2.pk
+++ /dev/null
@@ -1,4 +0,0 @@
-/* { dg-do run } */
-
-/* { dg-command { ltrim (",1,2,3", ",") } } */
-/* { dg-output "1,2,3" } */
diff --git a/testsuite/poke.std/ltrim-3.pk b/testsuite/poke.std/ltrim-3.pk
deleted file mode 100644
index 08fe01bc..00000000
--- a/testsuite/poke.std/ltrim-3.pk
+++ /dev/null
@@ -1,4 +0,0 @@
-/* { dg-do run } */
-
-/* { dg-command { ltrim (".,1,2,3", ",.") } } */
-/* { dg-output "1,2,3" } */
diff --git a/testsuite/poke.std/qsort.pk b/testsuite/poke.std/qsort.pk
deleted file mode 100644
index 41eeff4b..00000000
--- a/testsuite/poke.std/qsort.pk
+++ /dev/null
@@ -1,28 +0,0 @@
-/* { dg-do run } */
-/* { dg-data {c*} {0x00 0x00 0x00 0x30  0x00 0x00 0x00 0x00  0x00 0x00 0x00 
0x20 0x00 0x00 0x00 0x10 } } */
-
-fun cmpints = (any a, any b) int:
-  {
-   var ai = a as int;
-   var bi = b as int;
-
-   if (ai == bi)
-     return 0;
-   else if (ai < bi)
-     return -1;
-   else
-     return 1;
-  }
-
-/* { dg-command { .set obase 16 } } */
-/* { dg-command { .set endian big } } */
-
-/* { dg-command { var a = int[4] @ 0#B } } */
-/* { dg-command { qsort (a, cmpints) } } */
-/* { dg-command { a } } */
-/* { dg-output "\\\[0x0,0x10,0x20,0x30\\\]" } */
-
-/* { dg-command { var b = [2,3,1,0] } } */
-/* { dg-command { qsort (b, cmpints) } } */
-/* { dg-command { b} } */
-/* { dg-output "\n\\\[0x0,0x1,0x2,0x3\\\]" } */
diff --git a/testsuite/poke.std/rtrim-1.pk b/testsuite/poke.std/rtrim-1.pk
deleted file mode 100644
index b62bf613..00000000
--- a/testsuite/poke.std/rtrim-1.pk
+++ /dev/null
@@ -1,4 +0,0 @@
-/* { dg-do run } */
-
-/* { dg-command { rtrim ("  a string to trim  ") } } */
-/* { dg-output "  a string to trim" } */
diff --git a/testsuite/poke.std/rtrim-2.pk b/testsuite/poke.std/rtrim-2.pk
deleted file mode 100644
index ca8c2697..00000000
--- a/testsuite/poke.std/rtrim-2.pk
+++ /dev/null
@@ -1,4 +0,0 @@
-/* { dg-do run } */
-
-/* { dg-command { rtrim ("1,2,3,", ",") } } */
-/* { dg-output "1,2,3" } */
diff --git a/testsuite/poke.std/rtrim-3.pk b/testsuite/poke.std/rtrim-3.pk
deleted file mode 100644
index 4d9a49ab..00000000
--- a/testsuite/poke.std/rtrim-3.pk
+++ /dev/null
@@ -1,4 +0,0 @@
-/* { dg-do run } */
-
-/* { dg-command { ltrim ("1,2,3,.", ",.") } } */
-/* { dg-output "1,2,3" } */
diff --git a/testsuite/poke.std/std-test.pk b/testsuite/poke.std/std-test.pk
new file mode 100644
index 00000000..eeeca451
--- /dev/null
+++ b/testsuite/poke.std/std-test.pk
@@ -0,0 +1,193 @@
+
+/* Copyright (C) 2020 The poke authors */
+
+/* This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+load pktest;
+
+var tests = [
+  PkTest {
+    name = "atoi valid inputs",
+    func = lambda (string name) void:
+      {
+        assert (atoi ("0", 2) == 0L);
+        assert (atoi ("1", 2) == 1L);
+        assert (atoi ("111111111", 2) == 511L);
+        assert (atoi ("x", 2) == 0L);
+        assert (atoi ("1111x234", 2) == 15L);
+
+        assert (atoi ("1777", 8) == 1023L);
+
+        assert (atoi ("1777", 10) == 1777L);
+        assert (atoi ("1777") == 1777L);
+
+        assert (atoi ("fce2", 16) == 64738L);
+        assert (atoi ("bEeF", 16) == 48879L);
+        assert (atoi ("deadbeef", 16) == -559038737L);
+      },
+  },
+  PkTest {
+    name = "atoi invalid inputs",
+    func = lambda (string name) void:
+      {
+        try
+          {
+            atoi ("1234", 3);
+            assert (0, "unreachable reached!");
+          }
+        catch if E_generic
+          {
+            assert (1, "expects exception");
+          }
+
+        try
+          {
+            atoi ("deadbeef", 88);
+            assert (0, "unreachable reached!");
+          }
+        catch if E_inval
+          {
+            assert (1, "expects exception");
+          }
+      },
+  },
+  PkTest {
+    name = "catos",
+    func = lambda (string name) void:
+      {
+        assert (catos (['a','b','c']) == "abc");
+        assert (catos (['\0']) == "");
+        assert (catos (['a','\0','b']) == "a");
+      },
+  },
+  PkTest {
+    name = "stoca",
+    func = lambda (string name) void:
+      {
+        var A = [1UB,2UB,3UB,4UB];
+        var array = A[:];
+
+        stoca ("foo", array);
+        assert (array == [102UB, 111UB, 111UB, 0UB]);
+
+        array = A[:];
+        stoca("", array);
+        assert (array == [0UB,0UB,0UB,0UB]);
+
+        array = A[:];
+        stoca ("foo", array, 'x');
+        assert (array == [102UB,111UB,111UB,120UB]);
+
+        try
+          {
+            array = A[:];
+            stoca ("foooo", array);
+            assert (0, "unreachable reached!");
+          }
+        catch if E_out_of_bounds
+          {
+            assert (1);
+          }
+      },
+  },
+  PkTest {
+    name = "strchr",
+    func = lambda (string name) void:
+      {
+        assert (strchr ("foo", 'o') == 1);
+        assert (strchr ("foo", 'x') == 3);
+        assert (strchr ("", 'x') == 0);
+      },
+  },
+  PkTest {
+    name = "crc32",
+    func = lambda (string name) void:
+      {
+        assert (crc32 ([0x01UB, 0x02UB, 0x03UB, 0x04UB, 0x05UB, 0x06UB,
+                        0x07UB, 0x08UB]) == 0x3fca88c5U);
+      },
+  },
+  PkTest {
+    name = "ltrim",
+    func = lambda (string name) void:
+      {
+        assert (ltrim ("  a string to trim  ") == "a string to trim  ");
+        assert (ltrim (",1,2,3,", ",") == "1,2,3,");
+        assert (ltrim (".,1,2,3.,", ",.") == "1,2,3.,");
+      },
+  },
+  PkTest {
+    name = "rtrim",
+    func = lambda (string name) void:
+      {
+        assert (rtrim ("  a string to trim  ") == "  a string to trim");
+        assert (rtrim (",1,2,3,", ",") == ",1,2,3");
+        assert (rtrim (",.1,2,3,.", ",.") == ",.1,2,3");
+      },
+  },
+  PkTest {
+    name = "qsort",
+    func = lambda (string name) void:
+      {
+        fun cmpints = (any a, any b) int:
+          {
+            var ai = a as int;
+            var bi = b as int;
+
+            if (ai == bi)
+              return 0;
+            else if (ai < bi)
+              return -1;
+            else
+              return 1;
+          }
+
+        /* sort data in memory */
+        {
+          var data = open("*data*");
+          var end = get_endian;
+          var a = int[4] @ 0#B;
+
+          uint<8>[16] @ data : 0#B = [
+            0x00UB, 0x00UB, 0x00UB, 0x30UB, 0x00UB, 0x00UB, 0x00UB, 0x00UB,
+            0x00UB, 0x00UB, 0x00UB, 0x20UB, 0x00UB, 0x00UB, 0x00UB, 0x10UB,
+          ];
+          set_endian (ENDIAN_BIG);
+
+          assert (a == [0x30, 0x00, 0x20, 0x10]);
+          qsort (a, cmpints);
+          assert (a == [0x00, 0x10, 0x20, 0x30]);
+          assert ((uint<8>[16] @ data : 0#B) ==
+                  [0x00UB, 0x00UB, 0x00UB, 0x00UB,
+                   0x00UB, 0x00UB, 0x00UB, 0x10UB,
+                   0x00UB, 0x00UB, 0x00UB, 0x20UB,
+                   0x00UB, 0x00UB, 0x00UB, 0x30UB]);
+
+          set_endian (end);
+          close (data);
+        }
+
+        var b = [2,3,1,0];
+
+        qsort (b, cmpints);
+        assert (b == [0, 1, 2, 3]);
+
+        /* sort an r-value (useless) */
+        qsort ([4,3,2,1], cmpints);
+      },
+  },
+];
+
+pktest_run (tests);
diff --git a/testsuite/poke.std/std.exp b/testsuite/poke.std/std.exp
index 6d595b76..013c9704 100644
--- a/testsuite/poke.std/std.exp
+++ b/testsuite/poke.std/std.exp
@@ -1,22 +1,6 @@
-# std.exp - Tests's for poke's standard library
-#
-#   Copyright (C) 2019, 2020 Jose E. Marchesi
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, 
USA.
 
-load_lib ${tool}-dg.exp
-dg-init
-dg-runtest [lsort [glob -nocomplain $srcdir/poke.std/*.pk]] {} {}
-dg-finish
+load_lib "poke.exp"
+
+if { [simple_verified_host_execute "poke.std/run-pktests-std"] ne "" } {
+    fail "testing pickles failed"
+}
diff --git a/testsuite/poke.std/stoca-1.pk b/testsuite/poke.std/stoca-1.pk
deleted file mode 100644
index bf98039e..00000000
--- a/testsuite/poke.std/stoca-1.pk
+++ /dev/null
@@ -1,7 +0,0 @@
-/* { dg-do run } */
-
-var array = [1UB,2UB,3UB,4UB];
-
-/* { dg-command { stoca ("foo", array) } } */
-/* { dg-command { array } } */
-/* { dg-output "\\\[102UB,111UB,111UB,0UB\\\]" } */
diff --git a/testsuite/poke.std/stoca-2.pk b/testsuite/poke.std/stoca-2.pk
deleted file mode 100644
index 0b88243c..00000000
--- a/testsuite/poke.std/stoca-2.pk
+++ /dev/null
@@ -1,7 +0,0 @@
-/* { dg-do run } */
-
-var array = [1UB,2UB,3UB,4UB];
-
-/* { dg-command { stoca ("", array) } } */
-/* { dg-command { array } } */
-/* { dg-output "\\\[0UB,0UB,0UB,0UB\\\]" } */
diff --git a/testsuite/poke.std/stoca-3.pk b/testsuite/poke.std/stoca-3.pk
deleted file mode 100644
index c02cdb57..00000000
--- a/testsuite/poke.std/stoca-3.pk
+++ /dev/null
@@ -1,7 +0,0 @@
-/* { dg-do run } */
-
-var array = [1UB,2UB,3UB,4UB];
-
-/* { dg-command { stoca ("foo", array, 'x') } } */
-/* { dg-command { array } } */
-/* { dg-output "\\\[102UB,111UB,111UB,120UB\\\]" } */
diff --git a/testsuite/poke.std/stoca-4.pk b/testsuite/poke.std/stoca-4.pk
deleted file mode 100644
index 3322e07f..00000000
--- a/testsuite/poke.std/stoca-4.pk
+++ /dev/null
@@ -1,6 +0,0 @@
-/* { dg-do run } */
-
-var array = [1UB,2UB,3UB,4UB];
-
-/* { dg-command { try stoca ("foooo", array); catch if E_out_of_bounds { print 
"caught\n"; } } } */
-/* { dg-output "caught" } */
diff --git a/testsuite/poke.std/strchr-1.pk b/testsuite/poke.std/strchr-1.pk
deleted file mode 100644
index 1a55edbc..00000000
--- a/testsuite/poke.std/strchr-1.pk
+++ /dev/null
@@ -1,5 +0,0 @@
-/* { dg-do run } */
-
-/* { dg-command { .set obase 10 } } */
-/* { dg-command { strchr ("foo", 'o') } } */
-/* { dg-output "1" } */
diff --git a/testsuite/poke.std/strchr-2.pk b/testsuite/poke.std/strchr-2.pk
deleted file mode 100644
index b815d5ac..00000000
--- a/testsuite/poke.std/strchr-2.pk
+++ /dev/null
@@ -1,5 +0,0 @@
-/* { dg-do run } */
-
-/* { dg-command { .set obase 10 } } */
-/* { dg-command { strchr ("foo", 'x') } } */
-/* { dg-output "3" } */
diff --git a/testsuite/poke.std/strchr-3.pk b/testsuite/poke.std/strchr-3.pk
deleted file mode 100644
index 23c20724..00000000
--- a/testsuite/poke.std/strchr-3.pk
+++ /dev/null
@@ -1,5 +0,0 @@
-/* { dg-do run } */
-
-/* { dg-command { .set obase 10 } } */
-/* { dg-command { strchr ("", 'x') } } */
-/* { dg-output "0" } */
diff --git a/testsuite/run-pktests.in b/testsuite/run-pktests.in
new file mode 100644
index 00000000..b6709073
--- /dev/null
+++ b/testsuite/run-pktests.in
@@ -0,0 +1,37 @@
+#!/bin/sh
+
+# Executes PkTests and translate TAP output to something understandable
+# by DejaGNU.
+
+# Copyright (C) 2020 The poke authors
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+s="@abs_top_srcdir@"
+b="@abs_top_builddir@"
+c=@test_component@
+
+t() {
+  "$b"/run poke -q -L "$1" \
+  | awk '
+    /^ok/     && / # SKIP/ { gsub(/^ok/,     "\tUNTESTED: "); print }
+    /^ok/     && / # TODO/ { gsub(/^ok/,     "\tXPASSED: ");  print }
+    /^not ok/ && / # TODO/ { gsub(/^not ok/, "\tXFAILED: ");  print }
+    /^ok/                  { gsub(/^ok/,     "\tPASSED: ");   print }
+    /^not ok/              { gsub(/^not ok/, "\tFAILED: ");   print }
+  '
+}
+
+find "$s"/testsuite/poke.$c/ -name '*-test.pk' \
+| while read f; do t "$f"; done
-- 
2.29.2



reply via email to

[Prev in Thread] Current Thread [Next in Thread]