Compare commits
31 Commits
0.13.17
...
ee7b7e89b2
| Author | SHA1 | Date | |
|---|---|---|---|
|
ee7b7e89b2
|
|||
|
91de98cea3
|
|||
|
bd09d16949
|
|||
|
ce8a0a5be3
|
|||
|
94873a2ddc
|
|||
|
aa819cabc2
|
|||
|
7939985c98
|
|||
|
45329ccb8c
|
|||
|
014485d3c5
|
|||
|
5cfccf75af
|
|||
|
c88c41b213
|
|||
|
406feb3dc7
|
|||
|
787f0dc6e2
|
|||
|
94ada03ce4
|
|||
|
9bfc587623
|
|||
|
8508479a5b
|
|||
|
e028844825
|
|||
|
f022121436
|
|||
|
e278307daf
|
|||
|
4ad9e0da92
|
|||
|
0113cf793d
|
|||
|
1aa2b596d0
|
|||
|
c6f30c4195
|
|||
|
3398fc372c
|
|||
|
28f2d44e2f
|
|||
|
aefa87d9e5
|
|||
|
057f5571d6
|
|||
|
e7021e127c
|
|||
|
417d7ca405
|
|||
|
f7a74dc430
|
|||
|
cabe08bca4
|
@@ -99,9 +99,10 @@ their editor or terminal.
|
||||
|
||||
For usage text and help messages, do not implement a -h option. Instead, print
|
||||
usage information when any erroneous option is specified. Follow the NetBSD
|
||||
style guide for the usage text’s output format [1].
|
||||
style guide for the usage text’s output format [0].
|
||||
|
||||
[1] <http://cvsweb.netbsd.org/bsdweb.cgi/~checkout~/src/share/misc/style>
|
||||
If committing a new utility, please include tests and documentation (see
|
||||
tests/ and docs/) for the new tool.
|
||||
|
||||
If committing a new source file, format the commit message following these
|
||||
guidelines:
|
||||
@@ -130,6 +131,7 @@ $ git commit -m 'tool(1): fix #42 & add feature x'
|
||||
|
||||
Commit messages should be written in the present tense.
|
||||
|
||||
[0] <http://cvsweb.netbsd.org/bsdweb.cgi/~checkout~/src/share/misc/style>
|
||||
--
|
||||
This work © 2023–2024 by Emma Tebibyte is licensed under CC BY-SA 4.0. To view a
|
||||
copy of this license, visit <http://creativecommons.org/licenses/by-sa/4.0/>
|
||||
|
||||
11
Makefile
11
Makefile
@@ -31,6 +31,13 @@ RUSTLIBS = --extern getopt=build/o/libgetopt.rlib \
|
||||
--extern strerror=build/o/libstrerror.rlib
|
||||
CFLAGS += -I$(SYSEXITS)
|
||||
|
||||
# testing requires the absolute path to the bin directory set
|
||||
BIN = build/bin
|
||||
include tests/tests.mk
|
||||
|
||||
.PHONY: default
|
||||
default: all test
|
||||
|
||||
.PHONY: all
|
||||
all: dj false fop hru intcmp mm npc rpn scrut str strcmp swab true
|
||||
|
||||
@@ -53,9 +60,9 @@ install: dist
|
||||
cp -r $(DESTDIR)/* /
|
||||
|
||||
.PHONY: test
|
||||
test: build /tmp/getopt
|
||||
test: all $(TESTS) /tmp/getopt
|
||||
@echo $(TESTS)
|
||||
/tmp/getopt
|
||||
tests/posix-compat.sh
|
||||
|
||||
/tmp/getopt: src/libgetopt.rs
|
||||
$(RUSTC) --test -o /tmp/getopt src/libgetopt.rs
|
||||
|
||||
60
tests/README
Normal file
60
tests/README
Normal file
@@ -0,0 +1,60 @@
|
||||
The testing suite contains two main trees (plus translations for strings used in
|
||||
the shell scripts): the Bonsai tree and the POSIX tree:
|
||||
|
||||
.
|
||||
├── bonsai
|
||||
│ ├── test_env
|
||||
│ ├── dj.sh
|
||||
│ ├── false.sh
|
||||
│ ├── fop.sh
|
||||
│ ├── hru.sh
|
||||
│ ├── intcmp.sh
|
||||
│ ├── mm.sh
|
||||
│ ├── strcmp.sh
|
||||
│ └── true.sh
|
||||
├── locales
|
||||
│ ├── en_US.UTF-8
|
||||
│ └── tok
|
||||
├── posix
|
||||
│ ├── bin
|
||||
│ │ ├── cat
|
||||
│ │ ├── false
|
||||
│ │ └── true
|
||||
│ └── posix_env
|
||||
├── README
|
||||
└── test.sh
|
||||
|
||||
The Bonsai tree tests the functionality of Harakit utilities for regressions and
|
||||
other issues relating to compliance to our standards of practice.
|
||||
|
||||
The POSIX tree tests the use of Harakit utilities in place of the standard usage
|
||||
of POSIX utilities. These scripts test the ability of Harakit to comply to POSIX
|
||||
standards using its native utilities in shell scripts as a compatibility shim.
|
||||
Each shell script in the top directory should contain a set of tests for each
|
||||
POSIX utility and be named for that utility. The bin directory should contain
|
||||
a set of shim scripts which will be imported into the path as POSIX utilities.
|
||||
Each test will compare the behavior of the shim script to the real utility on
|
||||
the system.
|
||||
|
||||
Currently, due to the limitations of POSIX shell quoting, a subset of argument
|
||||
parsing is supported: arguments containing characters from POSIX’s Portable
|
||||
Filename Character Set [0].
|
||||
|
||||
The bonsai/test_env and posix/posix_env files contain prerequisite shared
|
||||
environments for each of the tests. These scripts both contain lines which set
|
||||
the shell to write all commands run in them (-x) and to fail if any command
|
||||
fails (-e). See set(1p) for more information.
|
||||
|
||||
Both sets of tests also inherit the environment set by the test.sh script, which
|
||||
sets the $BIN environment variable to the bin directory at the root of the
|
||||
project for easy and idiomatic access to the built Harakit binaries. When
|
||||
calling the POSIX test scripts, test.sh also sets the variable $realutil to be
|
||||
the absolute path to the currently tested utility’s counterpart on the system.
|
||||
|
||||
[0] <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_282>
|
||||
|
||||
--
|
||||
Copyright © 2024 Emma Tebibyte <emma@tebibyte.media>
|
||||
|
||||
This work is licensed under CC BY-SA 4.0. To view a copy of this license, visit
|
||||
<http://creativecommons.org/licenses/by-sa/4.0/>.
|
||||
48
tests/bonsai/dj.mk
Executable file
48
tests/bonsai/dj.mk
Executable file
@@ -0,0 +1,48 @@
|
||||
# Copyright (c) 2024 DTB <trinity@trinity.moe>
|
||||
# Copyright (c) 2024 Emma Tebibyte <emma@tebibyte.media>
|
||||
# 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.
|
||||
|
||||
.PRAGMA: command_comment
|
||||
|
||||
/dev/full:
|
||||
/dev/null:
|
||||
|
||||
.PHONY: dj_tests
|
||||
dj_tests: dj_help dj_full dj_null # dj_skip_stdin
|
||||
|
||||
.PHONY: dj_full
|
||||
# Linux has a /dev/full pseudodevice useful for testing errors.
|
||||
dj_full: $(BIN)/dj /dev/full
|
||||
case "$$(uname)" in \
|
||||
Linux) \
|
||||
$(BIN)/dj -Hi /dev/zero -o /dev/full 2>&1 \
|
||||
| tee /dev/tty \
|
||||
| xargs -I out test '1+0 > 0+0; 1024 > 0' = out \
|
||||
;; \
|
||||
esac
|
||||
|
||||
.PHONY: dj_help
|
||||
dj_help: $(BIN)/dj
|
||||
! $(BIN)/dj -h
|
||||
|
||||
.PHONY: dj_null
|
||||
# Read nothing from /dev/null, write nothing to /dev/null.
|
||||
dj_null: $(BIN)/dj /dev/null
|
||||
$(BIN)/dj -Hi /dev/null -o /dev/null 2>&1 \
|
||||
| tee /dev/tty \
|
||||
| xargs -I out test '0+0 > 0+0; 0 > 0' = out
|
||||
|
||||
# This test currently fails. This is probably due to dj(1) being stale relative
|
||||
# to the main harakit branch. TODO: Reassess once the testing branch is merged.
|
||||
# .PHONY: dj_skip_stdin
|
||||
# # Test skipping stdin.
|
||||
# dj_skip_stdin: $(BIN)/dj
|
||||
# # Pipe 1024B of '\0' into dj(1); skip the first 24B; expect 1000B written.
|
||||
# dd count=1 bs=1024 </dev/zero 2>/dev/null \
|
||||
# | $(BIN)/dj -H -s 24 -o /dev/null 2>&1 \
|
||||
# | tee /dev/tty \
|
||||
# | xargs -I out test '1+0 > 1+0; 1024 > 1000' = out
|
||||
18
tests/bonsai/false.mk
Executable file
18
tests/bonsai/false.mk
Executable file
@@ -0,0 +1,18 @@
|
||||
# Copyright (c) 2024 DTB <trinity@trinity.moe>
|
||||
# Copyright (c) 2024 Emma Tebibyte <emma@tebibyte.media>
|
||||
# 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.
|
||||
|
||||
.PHONY: false_tests
|
||||
false_tests: false_test false_help
|
||||
|
||||
.PHONY: false
|
||||
false_test: $(BIN)/false
|
||||
! $(BIN)/false
|
||||
|
||||
.PHONY: false_help
|
||||
false_help: $(BIN)/false
|
||||
! $(BIN)/false -h
|
||||
31
tests/bonsai/fop.mk
Executable file
31
tests/bonsai/fop.mk
Executable file
@@ -0,0 +1,31 @@
|
||||
# Copyright (c) 2024 Emma Tebibyte <emma@tebibyte.media>
|
||||
# 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.
|
||||
|
||||
.PHONY: fop_tests
|
||||
fop_tests: fop_functionality fop_delimiter fop_help fop_fail
|
||||
|
||||
.PHONY: fop_help
|
||||
fop_help: $(BIN)/fop
|
||||
! $(BIN)/fop -h
|
||||
|
||||
.PHONY: fop_delimiter
|
||||
fop_delimiter: $(BIN)/fop
|
||||
test "$$(printf 'test1 test1 test1\n' | $(BIN)/fop -d' ' 2 sed 's/2/4/g')" \
|
||||
= 'test1 test1 test4'
|
||||
test "$$(printf 'meowsetwoofsetribbit\n' \
|
||||
| $(BIN)/fop -d 'set' 1 sed 's/woof/meow/g')" = 'meowsetmeowsetribbit'
|
||||
|
||||
.PHONY: fop_fail
|
||||
fop_fail: $(BIN)/fop
|
||||
! printf 'test\n' | $(BIN)/fop 1 cat
|
||||
! printf 'test\n' | $(BIN)/fop 'test' cat
|
||||
! printf 'test\n' | $(BIN)/fop -d'test' cat
|
||||
|
||||
.PHONY: fop_functionality
|
||||
fop_functionality: $(BIN)/fop
|
||||
test "$$(printf 'test1\036test1\036test1\n' | $(BIN)/fop 1 sed 's/1/4/g')" \
|
||||
= "$$(printf 'test1\036test4\036test1\n')"
|
||||
35
tests/bonsai/hru.mk
Executable file
35
tests/bonsai/hru.mk
Executable file
@@ -0,0 +1,35 @@
|
||||
# Copyright (c) 2024 Emma Tebibyte <emma@tebibyte.media>
|
||||
# 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.
|
||||
|
||||
NAME = hru
|
||||
TARGET = $(NAME)_tests
|
||||
BINARY = $(BIN)/$(NAME)
|
||||
|
||||
.PHONY: hru_tests
|
||||
hru_tests: $(BIN)/hru
|
||||
|
||||
.PHONY: hru_functionality
|
||||
hru_functionality: $(BIN)/hru
|
||||
test "$(printf '1234\n' | $(BIN)/hru)" = '1.2 kB'
|
||||
test "$(printf '0\n' | $(BIN)/hru)" = '0 B'
|
||||
|
||||
.PHONY: $(NAME_help)
|
||||
hru_help: $(BIN)/hru
|
||||
! $(BIN)/hru -h
|
||||
|
||||
.PHONY: hru_negative
|
||||
hru_negative: $(BIN)/hru
|
||||
! printf '%s\n' '-1' | $(BIN)/hru
|
||||
|
||||
.PHONY: hru_regressions
|
||||
hru_regressions: $(BIN)/hru
|
||||
n=1; \
|
||||
while true; \
|
||||
do n="$$(($$n * 10))"; \
|
||||
printf '%s\n' "$$n" | $(BIN)/hru || break; \
|
||||
done; \
|
||||
printf 'Max float: %s\n' "$$n"
|
||||
45
tests/bonsai/intcmp.mk
Executable file
45
tests/bonsai/intcmp.mk
Executable file
@@ -0,0 +1,45 @@
|
||||
# Copyright (c) 2024 DTB <trinity@trinity.moe>
|
||||
# Copyright (c) 2024 Emma Tebibyte <emma@tebibyte.media>
|
||||
# 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.
|
||||
|
||||
.PHONY: intcmp_tests
|
||||
intcmp_tests: intcmp_help intcmp_e intcmp_g intcmp_l intcmp_combined
|
||||
|
||||
.PHONY: intcmp_help
|
||||
intcmp_help: $(BIN)/intcmp
|
||||
! $(BIN)/intcmp -h
|
||||
|
||||
.PHONY: intcmp_e
|
||||
intcmp_e: $(BIN)/intcmp
|
||||
$(BIN)/intcmp -e 3 3 3 # ==
|
||||
! $(BIN)/intcmp -e 1 2 3 # <
|
||||
! $(BIN)/intcmp -e 3 2 1 # >
|
||||
|
||||
.PHONY: intcmp_g
|
||||
intcmp_g: $(BIN)/intcmp
|
||||
$(BIN)/intcmp -g 3 2 1 # >
|
||||
! $(BIN)/intcmp -g 3 3 3 # ==
|
||||
! $(BIN)/intcmp -g 1 2 3 # <
|
||||
$(BIN)/intcmp -ge 3 3 1 # >=
|
||||
! $(BIN)/intcmp -ge 1 2 3 # <
|
||||
|
||||
.PHONY: intcmp_l
|
||||
intcmp_l: $(BIN)/intcmp
|
||||
$(BIN)/intcmp -l 1 2 3 # <
|
||||
! $(BIN)/intcmp -l 3 3 3 # ==
|
||||
! $(BIN)/intcmp -l 3 2 1 # >
|
||||
$(BIN)/intcmp -le 1 3 3 # <=
|
||||
! $(BIN)/intcmp -le 3 2 1 # >
|
||||
|
||||
.PHONY: intcmp_combined
|
||||
intcmp_combined: $(BIN)/intcmp
|
||||
$(BIN)/intcmp -gl 1 2 3 # <
|
||||
$(BIN)/intcmp -gl 3 2 1 # >
|
||||
$(BIN)/intcmp -gl 1 3 1 # !=
|
||||
! $(BIN)/intcmp -gl 3 3 3 # ==
|
||||
$(BIN)/intcmp -egl 3 1 1 3 # >, ==, <
|
||||
! $(BIN)/intcmp -egl foo # huh?
|
||||
27
tests/bonsai/mm.mk
Executable file
27
tests/bonsai/mm.mk
Executable file
@@ -0,0 +1,27 @@
|
||||
# Copyright (c) 2024 E$(NAME)a Tebibyte <e$(NAME)a@tebibyte.media>
|
||||
# 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.
|
||||
|
||||
NAME = mm
|
||||
TARGET = $(NAME)_tests
|
||||
BINARY = $(BIN)/$(NAME)
|
||||
|
||||
.PHONY: mm_tests
|
||||
mm_tests: mm_args mm_help mm_stderr
|
||||
|
||||
.PHONY: mm_args
|
||||
# mm(1) will error if positional arguments are given without -i or -o
|
||||
mm_args: $(BIN)/mm
|
||||
! $(BIN)/mm argument
|
||||
|
||||
.PHONY: mm_help
|
||||
mm_help: $(BIN)/mm
|
||||
! $(BIN)/mm -h
|
||||
|
||||
.PHONY: mm_stderr
|
||||
# check if stderr is empty upon specifying -e
|
||||
mm_stderr: $(BIN)/mm
|
||||
! test "$$(printf 'test\n' | $(BIN)/mm -i - -e 2>&1 >/dev/null)" = "test"
|
||||
42
tests/bonsai/npc.mk
Executable file
42
tests/bonsai/npc.mk
Executable file
@@ -0,0 +1,42 @@
|
||||
#!/bin/sh
|
||||
# Copyright (c) 2024 DTB <trinity@trinity.moe>
|
||||
# Copyright (c) 2024 Emma Tebibyte <emma@tebibyte.media>
|
||||
# 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.
|
||||
|
||||
.PRAGMA: command_comment
|
||||
|
||||
.PHONY: npc_tests
|
||||
npc_tests: npc_args npc_help
|
||||
|
||||
.PHONY: npc_args
|
||||
# arg parsing
|
||||
npc_args:
|
||||
$(BIN)/npc -e </dev/null
|
||||
$(BIN)/npc -t </dev/null
|
||||
$(BIN)/npc -et </dev/null
|
||||
! $(BIN)/npc -et 5 </dev/null
|
||||
|
||||
.PHONY: npc_help
|
||||
npc_help: $(BIN)/npc
|
||||
! $(BIN)/npc -h
|
||||
|
||||
#i=0; while "$BIN"/intcmp -l $i 178; do
|
||||
# printf '\\%s\\n' "$i" \
|
||||
# | xargs -I fmt printf fmt
|
||||
#
|
||||
# # simulate octal
|
||||
# i="$(printf '1 + %s\n' "$i" | bc)"
|
||||
# printf '%s\n' "$i" \
|
||||
# | tail -c 1 \
|
||||
# | xargs "$BIN"/intcmp -e 8 \
|
||||
# && i="$(printf '2 + %s\n' "$i" | bc)"
|
||||
# printf '%s\n' "$i" \
|
||||
# | tail -c 2 \
|
||||
# | dd count=1 bs=1 2>/dev/null \
|
||||
# | xargs "$BIN"/intcmp -e 8 \
|
||||
# && i="$(printf '20 + %s\n' "$i" | bc)"
|
||||
#done
|
||||
31
tests/bonsai/strcmp.mk
Executable file
31
tests/bonsai/strcmp.mk
Executable file
@@ -0,0 +1,31 @@
|
||||
# Copyright (c) 2024 DTB <trinity@trinity.moe>
|
||||
# Copyright (c) 2024 Emma Tebibyte <emma@tebibyte.media>
|
||||
# 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.
|
||||
|
||||
NAME = strcmp
|
||||
TARGET = $(NAME)_tests
|
||||
BINARY = $(BIN)/$(NAME)
|
||||
|
||||
.PHONY: strcmp_tests
|
||||
strcmp_tests: strcmp_equals strcmp_help strcmp_nocmp strcmp_unequals
|
||||
|
||||
.PHONY: strcmp_equals
|
||||
strcmp_equals: $(BIN)/strcmp
|
||||
$(BIN)/strcmp equals equals
|
||||
$(BIN)/strcmp - -
|
||||
|
||||
.PHONY: strcmp_help
|
||||
strcmp_help: $(BIN)/strcmp
|
||||
! $(BIN)/strcmp -h
|
||||
|
||||
.PHONY: strcmp_nocmp
|
||||
strcmp_nocmp: $(BIN)/strcmp
|
||||
! $(BIN)/strcmp nocmp
|
||||
|
||||
.PHONY: strcmp_unequals
|
||||
strcmp_unequals: $(BIN)/strcmp
|
||||
! $(BIN)/strcmp unequals equals
|
||||
19
tests/bonsai/true.mk
Executable file
19
tests/bonsai/true.mk
Executable file
@@ -0,0 +1,19 @@
|
||||
#!/bin/sh
|
||||
# Copyright (c) 2024 DTB <trinity@trinity.moe>
|
||||
# Copyright (c) 2024 Emma Tebibyte <emma@tebibyte.media>
|
||||
# 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.
|
||||
|
||||
.PHONY: true_tests
|
||||
true_tests: true_test
|
||||
|
||||
.PHONY: true_help
|
||||
true_help: $(BIN)/true
|
||||
$(BIN)/true -h
|
||||
|
||||
.PHONY: true_test
|
||||
true_test: $(BIN)/true
|
||||
$(BIN)/true
|
||||
@@ -1,24 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Copyright (c) 2023–2024 Emma Tebibyte <emma@tebibyte.media>
|
||||
# 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.
|
||||
|
||||
set -e
|
||||
|
||||
if ! ls Makefile >/dev/null 2>&1
|
||||
then
|
||||
printf '%s: Run this script in the root of the project.\n' "$0" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
printf "Starting POSIX compatibility testing.\n"
|
||||
|
||||
for utility in tests/posix/*; do
|
||||
printf '%s: %s: Testing utility.\n' "$0" "$utility"
|
||||
"$utility"
|
||||
printf '\n'
|
||||
done
|
||||
22
tests/posix/bin/cat
Executable file
22
tests/posix/bin/cat
Executable file
@@ -0,0 +1,22 @@
|
||||
#!/bin/sh
|
||||
# Copyright (c) 2024 Emma Tebibyte <emma@tebibyte.media>
|
||||
# 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
|
||||
12
tests/posix/bin/false
Executable file
12
tests/posix/bin/false
Executable file
@@ -0,0 +1,12 @@
|
||||
#!/bin/sh
|
||||
# Copyright (c) 2024 DTB <trinity@trinity.moe>
|
||||
# Copyright (c) 2024 Emma Tebibyte <emma@tebibyte.media>
|
||||
# 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 "$@"
|
||||
11
tests/posix/bin/true
Executable file
11
tests/posix/bin/true
Executable file
@@ -0,0 +1,11 @@
|
||||
#!/bin/sh
|
||||
# Copyright (c) 2024 DTB <trinity@trinity.moe>
|
||||
# Copyright (c) 2024 Emma Tebibyte <emma@tebibyte.media>
|
||||
# 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 "$@"
|
||||
5
tests/posix/posix_env
Normal file
5
tests/posix/posix_env
Normal file
@@ -0,0 +1,5 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -ex
|
||||
|
||||
PATH="$PWD/bin:$PATH"
|
||||
15
tests/tests.mk
Normal file
15
tests/tests.mk
Normal file
@@ -0,0 +1,15 @@
|
||||
# Copyright (c) 2024 Emma Tebibyte <emma@tebibyte.media>
|
||||
# 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)
|
||||
Reference in New Issue
Block a user