diff options
author | Ori Bernstein <ori@eigenstate.org> | 2023-02-19 20:44:56 -0500 |
---|---|---|
committer | Ori Bernstein <ori@eigenstate.org> | 2023-02-19 20:44:56 -0500 |
commit | 31913a8524edf97ad79f9f895d6ac5761b9b2fd7 (patch) | |
tree | cc695a76c4a41527eb510c7c9462f059af652636 /sys/src/cmd/test/patch/patch.rc | |
parent | c3ba64f6935322f09b6de5c2285544fd471c605d (diff) |
mkfiles: add 'mk test' support
9front has several tests scattered throughout the source,
as well as more tests in an external 'regress' repository.
Many of these tests are broken, because there is no easy
way to build and track all of them.
This pulls in several tests from different sources, deletes
the broken tests, tests with missing data, and adds a single
command that can be run from the root of the src directory
to test our system.
The hope is that as we develop new code, we add more tests,
and eventually start running the tests on every commit.
Please enter the commit message for your changes. Lines starting
Diffstat (limited to 'sys/src/cmd/test/patch/patch.rc')
-rwxr-xr-x | sys/src/cmd/test/patch/patch.rc | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/sys/src/cmd/test/patch/patch.rc b/sys/src/cmd/test/patch/patch.rc new file mode 100755 index 000000000..28c222939 --- /dev/null +++ b/sys/src/cmd/test/patch/patch.rc @@ -0,0 +1,39 @@ +#!/bin/rc -e + +fn check{ + if(! cmp $1 $2){ + >[2=1] echo fail: $1 $2 + >[2=1] diff -u $1 $2 + exit mismatch + } + status=() +} + +fn checkpatch{ + rm -f $1.out + ../../$O.patch $1.patch + check $1.out $1.expected +} + +checkpatch basic +checkpatch header +checkpatch create + +seq 12 > delete.out +../../$O.patch delete.patch +test ! -f delete.out + +rm -f multifile^(1 2)^.out +chmod 640 multifile1.in +chmod 400 multifile2.in +../../$O.patch multifile.patch +check multifile1.out multifile1.expected +check multifile2.out multifile2.expected + +if(! ~ `{walk -ex multifile1.out} --rw-r-----) + exit misperm1 +if(! ~ `{walk -ex multifile2.out} --rw-------) + exit misperm2 + + +status=() |