-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add a standalone_simple contrib example
Signed-off-by: Jiri Jaburek <[email protected]>
- Loading branch information
Showing
10 changed files
with
67 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
c/run | ||
ptef |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
SHELL := /bin/bash | ||
PTEF_URL := https://github.com/comps/ptef/archive/refs/heads/main.tar.gz | ||
|
||
.PHONY: all clean | ||
all: ptef | ||
|
||
ptef: | ||
mkdir ptef-build && ( \ | ||
cd ptef-build && \ | ||
curl -kL "$(PTEF_URL)" | tar -xvz --strip-components=1 && \ | ||
make && \ | ||
make install DESTDIR="$(PWD)/ptef" \ | ||
) | ||
rm -rf ptef-build | ||
|
||
clean: | ||
rm -rf ptef-build ptef |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
This shows how to make a test suite building its own PTEF binaries, independent | ||
of anything provided by the OS. | ||
|
||
This is a CLI-only trivial version of the 'standalone' example - see that one | ||
if you need full C / bash / python API support. | ||
|
||
The advantage of this version is that it has very minimal build dependencies | ||
- basically just a C compiler and GNU Make, that's it. If all you care about | ||
is running ptef-* CLI commands from shell-based tests, that's all you need. | ||
|
||
Do ie. | ||
|
||
dnf install gcc make curl | ||
|
||
prior to issuing 'make' and './run'. | ||
|
||
To run tests from inside the hierarchy manually (rather than running the full | ||
suite), source the 'run' in top level first (from a bash shell). | ||
This will export some env variables into your current shell. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
|
||
# this could be any shell | ||
|
||
ptef-report TESTME "from-inside" | ||
|
||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash | ||
|
||
export PATH="$PWD/ptef/usr/bin:$PATH" | ||
|
||
# if sourcing, exit now | ||
return 2>/dev/null | ||
|
||
base=$(basename "$0") | ||
ptef-runner -a "$base" "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../ptef/usr/bin/ptef-runner |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash | ||
echo foo bar >&2 | ||
exit 0 |