diff options
author | Bryce Harrington <bryce@canonical.com> | 2012-01-10 07:41:54 -0800 |
---|---|---|
committer | Bryce Harrington <bryce@canonical.com> | 2012-01-10 07:41:54 -0800 |
commit | d580dc54c4ddae2fae50274ce6877509d838d55b (patch) | |
tree | b506a0269551e251dbdcf2c9bde15134b9f83045 | |
parent | b0f6d213045feab3cff448e2e5a1116adb5c729e (diff) |
Add an A/B test comparing our xrandr's output with the installed xrandr
-rwxr-xr-x | examples/before_and_after.sh | 23 | ||||
-rw-r--r-- | examples/xrandr.c | 5 |
2 files changed, 27 insertions, 1 deletions
diff --git a/examples/before_and_after.sh b/examples/before_and_after.sh new file mode 100755 index 0000000..1ec3e73 --- /dev/null +++ b/examples/before_and_after.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env bash + +export DISPLAY=:0 + +compare_str() { + echo -n "${1}: " + if [ "${2}" = "${3}" ]; then + echo "PASS" + else + echo "FAIL" + fi +} + + +compare_str "version" "$(xrandr --version)" "$(./xrandr --version)" + +compare_str "help" "$(xrandr --help 2>&1)" "$(./xrandr --help 2>&1)" + +compare_str "basic status" "$(xrandr)" "$(./xrandr)" + +compare_str "verbose status" "$(xrandr --verbose)" "$(./xrandr --verbose)" + + diff --git a/examples/xrandr.c b/examples/xrandr.c index e7c2295..7ddddb4 100644 --- a/examples/xrandr.c +++ b/examples/xrandr.c @@ -41,6 +41,9 @@ #include "config.h" #include "XrandrUtils.h" +/* #define XRANDR_VERSION VERSION */ +#define XRANDR_VERSION "1.3.5" + static char *program_name; static Display *dpy; static Window root; @@ -2602,7 +2605,7 @@ main (int argc, char **argv) query_1 = True; } if (version) - printf("xrandr program version " VERSION "\n"); + printf("xrandr program version " XRANDR_VERSION "\n"); dpy = XOpenDisplay (display_name); |