summaryrefslogtreecommitdiffstats
path: root/tests.sh
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2020-05-22 12:20:10 -0400
committerTavian Barnes <tavianator@tavianator.com>2020-05-22 12:49:18 -0400
commit305ee902874b49351f4916e303c293523f11570b (patch)
treebd3e3d479d855cd0cad7fab1ff23b53ad7481b44 /tests.sh
parenta3a9a2ed41394c7ae9a1e5f57b0379b2c3a564d0 (diff)
downloadbfs-305ee902874b49351f4916e303c293523f11570b.tar.xz
opt: Track data flow information about predicates
This allows us to optimize things like -sparse -o -not -sparse <==> -true and -sparse -a -not -sparse <==> -false
Diffstat (limited to 'tests.sh')
-rwxr-xr-xtests.sh40
1 files changed, 28 insertions, 12 deletions
diff --git a/tests.sh b/tests.sh
index 4b0771e..df92a8e 100755
--- a/tests.sh
+++ b/tests.sh
@@ -209,6 +209,12 @@ posix_tests=(
test_newer
test_newer_link
+ test_nogroup
+ test_nogroup_ulimit
+
+ test_nouser
+ test_nouser_ulimit
+
test_ok_stdin
test_ok_plus_semicolon
@@ -253,6 +259,8 @@ posix_tests=(
test_de_morgan_not
test_de_morgan_and
test_de_morgan_or
+ test_data_flow_group
+ test_data_flow_user
test_data_flow_type
test_data_flow_and_swap
test_data_flow_or_swap
@@ -347,12 +355,6 @@ bsd_tests=(
test_newermt
test_newermt_epoch_minus_one
- test_nogroup
- test_nogroup_ulimit
-
- test_nouser
- test_nouser_ulimit
-
test_ok_stdin
test_ok_closed_stdin
@@ -497,12 +499,6 @@ gnu_tests=(
test_newermt
test_newermt_epoch_minus_one
- test_nogroup
- test_nogroup_ulimit
-
- test_nouser
- test_nouser_ulimit
-
test_ok_closed_stdin
test_ok_nothing
@@ -583,6 +579,7 @@ gnu_tests=(
test_and_false_or_true
test_comma_redundant_true
test_comma_redundant_false
+ test_data_flow_sparse
)
bfs_tests=(
@@ -662,6 +659,9 @@ bfs_tests=(
test_xtype_multi
test_xtype_reorder
+ # Optimizer tests
+ test_data_flow_hidden
+
# PATH_MAX handling
test_deep_strict
)
@@ -2289,6 +2289,22 @@ function test_data_flow_depth() {
bfs_diff basic -depth +1 -depth -4
}
+function test_data_flow_group() {
+ bfs_diff basic \( -group "$(id -g)" -nogroup \) -o \( -group "$(id -g)" -o -nogroup \)
+}
+
+function test_data_flow_user() {
+ bfs_diff basic \( -user "$(id -u)" -nouser \) -o \( -user "$(id -u)" -o -nouser \)
+}
+
+function test_data_flow_hidden() {
+ bfs_diff basic \( -hidden -not -hidden \) -o \( -hidden -o -not -hidden \)
+}
+
+function test_data_flow_sparse() {
+ bfs_diff basic \( -sparse -not -sparse \) -o \( -sparse -o -not -sparse \)
+}
+
function test_data_flow_type() {
bfs_diff basic \! \( -type f -o \! -type f \)
}