From 0e9127d417f71bbb3435793dc7683353cfa51a9b Mon Sep 17 00:00:00 2001 From: emma Date: Mon, 24 Feb 2025 23:28:52 -0700 Subject: [PATCH] tests: removed POSIX testing (fixes #163) --- Makefile | 7 ++++++- tests/README | 31 ++++++++++--------------------- tests/{bonsai => }/dj.mk | 0 tests/{bonsai => }/false.mk | 0 tests/{bonsai => }/fileis.mk | 0 tests/{bonsai => }/fop.mk | 0 tests/{bonsai => }/hru.mk | 0 tests/{bonsai => }/intcmp.mk | 0 tests/{bonsai => }/mm.mk | 0 tests/{bonsai => }/npc.mk | 0 tests/{bonsai => }/peek.mk | 0 tests/posix/bin/cat | 22 ---------------------- tests/posix/bin/false | 12 ------------ tests/posix/bin/true | 11 ----------- tests/posix/posix_env | 5 ----- tests/{bonsai => }/rpn.mk | 0 tests/{bonsai => }/str.mk | 0 tests/{bonsai => }/strcmp.mk | 0 tests/{bonsai => }/swab.mk | 0 tests/tests.mk | 15 --------------- tests/{bonsai => }/true.mk | 0 21 files changed, 16 insertions(+), 87 deletions(-) rename tests/{bonsai => }/dj.mk (100%) rename tests/{bonsai => }/false.mk (100%) rename tests/{bonsai => }/fileis.mk (100%) rename tests/{bonsai => }/fop.mk (100%) rename tests/{bonsai => }/hru.mk (100%) rename tests/{bonsai => }/intcmp.mk (100%) rename tests/{bonsai => }/mm.mk (100%) rename tests/{bonsai => }/npc.mk (100%) rename tests/{bonsai => }/peek.mk (100%) delete mode 100755 tests/posix/bin/cat delete mode 100755 tests/posix/bin/false delete mode 100755 tests/posix/bin/true delete mode 100644 tests/posix/posix_env rename tests/{bonsai => }/rpn.mk (100%) rename tests/{bonsai => }/str.mk (100%) rename tests/{bonsai => }/strcmp.mk (100%) rename tests/{bonsai => }/swab.mk (100%) delete mode 100644 tests/tests.mk rename tests/{bonsai => }/true.mk (100%) diff --git a/Makefile b/Makefile index 3e6c0e3..d509328 100644 --- a/Makefile +++ b/Makefile @@ -62,7 +62,12 @@ dist: all docs install: dist cp -r $(DESTDIR)/* / -include tests/tests.mk +TESTFILES != for file in tests/*.mk; do printf '%s ' "$$file"; done + +TESTS != printf '%s\n' "$(TESTFILES)" | xargs -n1 basename \ + | sed 's/\.mk/_tests/g' + +include $(TESTFILES) .PHONY: test test: all $(TESTS) /tmp/getopt diff --git a/tests/README b/tests/README index 7e7508c..8c2958e 100644 --- a/tests/README +++ b/tests/README @@ -1,24 +1,13 @@ -The testing suite contains two trees: the Bonsai tree and the POSIX tree: +Tests +===== -. -├── README -├── bonsai/ -│   ├── dj.mk -│   ├── false.mk -│   ├── fop.mk -│   └── ... -├── posix/ -└── tests.mk +The Harakit testing suite verifies the functionality of Harakit utilities +and checks for regressions and other issues relating to compliance to our +standards of practice. -The Bonsai tree tests the functionality of Harakit utilities for regressions and -other issues relating to compliance to our standards of practice. - -The POSIX tests are currently a work-in-progress. Their status in this -repository is uncertain. - -Both sets of tests also inherit the environment set by the top-level Makefile, -which sets the BIN variable to the build/bin directory at the root of the -project; therefore, each binary is located at $(BIN)/tool for idiomatic access. +Tests inherit the environment set by the top-level Makefile, which sets the BIN +variable to the build/bin directory at the root of the project; therefore, each +binary is located at $(BIN)/tool for idiomatic access. Each test contains a set of PHONY targets which are prefixed with the name of the tool being tested and an underscore. The first target is tests, which @@ -27,10 +16,10 @@ included in the top Makefile, so they can be called from the root of the repository. This also means that BIN can be set manually so that tests can be run using make(1) inside of the tests directory: - $ make -f tests.mk BIN=../build/bin dj_tests + $ make -f dj.mk BIN=../build/bin dj_tests -- -Copyright © 2024 Emma Tebibyte +Copyright © 2024–2025 Emma Tebibyte This work is licensed under CC BY-SA 4.0. To view a copy of this license, visit . diff --git a/tests/bonsai/dj.mk b/tests/dj.mk similarity index 100% rename from tests/bonsai/dj.mk rename to tests/dj.mk diff --git a/tests/bonsai/false.mk b/tests/false.mk similarity index 100% rename from tests/bonsai/false.mk rename to tests/false.mk diff --git a/tests/bonsai/fileis.mk b/tests/fileis.mk similarity index 100% rename from tests/bonsai/fileis.mk rename to tests/fileis.mk diff --git a/tests/bonsai/fop.mk b/tests/fop.mk similarity index 100% rename from tests/bonsai/fop.mk rename to tests/fop.mk diff --git a/tests/bonsai/hru.mk b/tests/hru.mk similarity index 100% rename from tests/bonsai/hru.mk rename to tests/hru.mk diff --git a/tests/bonsai/intcmp.mk b/tests/intcmp.mk similarity index 100% rename from tests/bonsai/intcmp.mk rename to tests/intcmp.mk diff --git a/tests/bonsai/mm.mk b/tests/mm.mk similarity index 100% rename from tests/bonsai/mm.mk rename to tests/mm.mk diff --git a/tests/bonsai/npc.mk b/tests/npc.mk similarity index 100% rename from tests/bonsai/npc.mk rename to tests/npc.mk diff --git a/tests/bonsai/peek.mk b/tests/peek.mk similarity index 100% rename from tests/bonsai/peek.mk rename to tests/peek.mk diff --git a/tests/posix/bin/cat b/tests/posix/bin/cat deleted file mode 100755 index e123d7c..0000000 --- a/tests/posix/bin/cat +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh -# Copyright (c) 2024 Emma Tebibyte -# SPDX-License-Identifier: FSFAP -# -# Copying and distribution of this file, with or without modification, are -# permitted in any medium without royalty provided the copyright notice and this -# notice are preserved. This file is offered as-is, without any warranty. - -# Strictly POSIX-compliant cat(1) implementation. See cat(1p) - -for arg in "$@"; do - case "$arg" in - -u) args="$(printf '%s %s\n' "$args" "$arg")" ;; - *) args="$(printf -- '%s -i %s\n' "$args" "$arg")" ;; - esac -done - -# See IEEE Std 1003.1-2017 3.282 -# https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_282 -IFS=' ' - -mm $args diff --git a/tests/posix/bin/false b/tests/posix/bin/false deleted file mode 100755 index 62a10c9..0000000 --- a/tests/posix/bin/false +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -# Copyright (c) 2024 DTB -# Copyright (c) 2024 Emma Tebibyte -# SPDX-License-Identifier: FSFAP -# -# Copying and distribution of this file, with or without modification, are -# permitted in any medium without royalty provided the copyright notice and this -# notice are preserved. This file is offered as-is, without any warranty. - -# Strictly POSIX-compliant false(1) implementation. See false(1p) - -false "$@" diff --git a/tests/posix/bin/true b/tests/posix/bin/true deleted file mode 100755 index aed1b86..0000000 --- a/tests/posix/bin/true +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh -# Copyright (c) 2024 DTB -# Copyright (c) 2024 Emma Tebibyte -# SPDX-License-Identifier: FSFAP -# -# Copying and distribution of this file, with or without modification, are -# permitted in any medium without royalty provided the copyright notice and this -# notice are preserved. This file is offered as-is, without any warranty. - -# Strictly POSIX-compliant true(1) implementation. See true(1p) -true "$@" diff --git a/tests/posix/posix_env b/tests/posix/posix_env deleted file mode 100644 index b436601..0000000 --- a/tests/posix/posix_env +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -set -ex - -PATH="$PWD/bin:$PATH" diff --git a/tests/bonsai/rpn.mk b/tests/rpn.mk similarity index 100% rename from tests/bonsai/rpn.mk rename to tests/rpn.mk diff --git a/tests/bonsai/str.mk b/tests/str.mk similarity index 100% rename from tests/bonsai/str.mk rename to tests/str.mk diff --git a/tests/bonsai/strcmp.mk b/tests/strcmp.mk similarity index 100% rename from tests/bonsai/strcmp.mk rename to tests/strcmp.mk diff --git a/tests/bonsai/swab.mk b/tests/swab.mk similarity index 100% rename from tests/bonsai/swab.mk rename to tests/swab.mk diff --git a/tests/tests.mk b/tests/tests.mk deleted file mode 100644 index 04f3680..0000000 --- a/tests/tests.mk +++ /dev/null @@ -1,15 +0,0 @@ -# Copyright (c) 2024 Emma Tebibyte -# SPDX-License-Identifier: FSFAP -# -# Copying and distribution of this file, with or without modification, are -# permitted in any medium without royalty provided the copyright notice and this -# notice are preserved. This file is offered as-is, without any warranty. - - -#TESTFILES != for file in tests/bonsai/*.mk tests/posix/*.mk; do printf '%s ' "$$file"; done; -TESTFILES != for file in tests/bonsai/*.mk; do printf '%s ' "$$file"; done; - -TESTS != printf '%s\n' "$(TESTFILES)" | xargs -n1 basename \ - | sed 's/\.mk/_tests/g' - -include $(TESTFILES) diff --git a/tests/bonsai/true.mk b/tests/true.mk similarity index 100% rename from tests/bonsai/true.mk rename to tests/true.mk