aboutsummaryrefslogtreecommitdiff
path: root/tests/functional/filter-source.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/functional/filter-source.sh')
-rw-r--r--tests/functional/filter-source.sh25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/functional/filter-source.sh b/tests/functional/filter-source.sh
new file mode 100644
index 000000000..ba34d2eac
--- /dev/null
+++ b/tests/functional/filter-source.sh
@@ -0,0 +1,25 @@
+source common.sh
+
+rm -rf $TEST_ROOT/filterin
+mkdir $TEST_ROOT/filterin
+mkdir $TEST_ROOT/filterin/foo
+touch $TEST_ROOT/filterin/foo/bar
+touch $TEST_ROOT/filterin/xyzzy
+touch $TEST_ROOT/filterin/b
+touch $TEST_ROOT/filterin/bak
+touch $TEST_ROOT/filterin/bla.c.bak
+ln -s xyzzy $TEST_ROOT/filterin/link
+
+checkFilter() {
+ test ! -e $1/foo/bar
+ test -e $1/xyzzy
+ test -e $1/bak
+ test ! -e $1/bla.c.bak
+ test ! -L $1/link
+}
+
+nix-build ./filter-source.nix -o $TEST_ROOT/filterout1
+checkFilter $TEST_ROOT/filterout1
+
+nix-build ./path.nix -o $TEST_ROOT/filterout2
+checkFilter $TEST_ROOT/filterout2