-
-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
202 additions
and
0 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
30 changes: 30 additions & 0 deletions
30
pkgs/build-support/setup-hooks/wrap-gapps-hook/tests/lib.nix
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,30 @@ | ||
{ runCommand | ||
}: | ||
|
||
rec { | ||
runTest = name: body: runCommand name { } '' | ||
set -o errexit | ||
${body} | ||
touch $out | ||
''; | ||
|
||
skip = cond: text: | ||
if cond then '' | ||
echo "Skipping test $name" > /dev/stderr | ||
'' else text; | ||
|
||
fail = text: '' | ||
echo "FAIL: $name: ${text}" > /dev/stderr | ||
exit 1 | ||
''; | ||
|
||
expectSomeLineContainingYInFileXToMentionZ = file: filter: expected: '' | ||
if ! cat "${file}" | grep "${filter}"; then | ||
${fail "The file “${file}” should include a line containing “${filter}”."} | ||
fi | ||
if ! cat "${file}" | grep "${filter}" | grep ${expected}; then | ||
${fail "The file “${file}” should include a line containing “${filter}” that also contains “${expected}”."} | ||
fi | ||
''; | ||
} |
30 changes: 30 additions & 0 deletions
30
pkgs/build-support/setup-hooks/wrap-gapps-hook/tests/sample-project/Makefile
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,30 @@ | ||
PREFIX = $(out) | ||
BINDIR = $(PREFIX)/bin | ||
LIBEXECDIR = $(PREFIX)/libexec | ||
LIBDIR = $(PREFIX)/lib | ||
TYPELIBDIR = $(LIBDIR)/girepository-1.0 | ||
|
||
all: | ||
echo "Compiling…" | ||
install: | ||
echo "Installing…" | ||
|
||
bin: | ||
mkdir -p $(BINDIR) | ||
# Adds `bin-${foo}` targets, that install `${foo}` executable to `$(BINDIR)`. | ||
bin-%: bin | ||
touch $(BINDIR)/$(@:bin-%=%) | ||
chmod +x $(BINDIR)/$(@:bin-%=%) | ||
|
||
libexec: | ||
mkdir -p $(LIBEXECDIR) | ||
# Adds `libexec-${foo}` targets, that install `${foo}` executable to `$(LIBEXECDIR)`. | ||
libexec-%: libexec | ||
touch $(LIBEXECDIR)/$(@:libexec-%=%) | ||
chmod +x $(LIBEXECDIR)/$(@:libexec-%=%) | ||
|
||
typelib: | ||
mkdir -p $(TYPELIBDIR) | ||
# Adds `typelib-${foo}` targets, that install `${foo}-1.0.typelib` file to `$(TYPELIBDIR)`. | ||
typelib-%: typelib | ||
touch $(TYPELIBDIR)/$(@:typelib-%=%)-1.0.typelib |