File tree Expand file tree Collapse file tree 4 files changed +20
-14
lines changed Expand file tree Collapse file tree 4 files changed +20
-14
lines changed Original file line number Diff line number Diff line change @@ -94,10 +94,10 @@ endif
9494test : test/test clean-coverage-run
9595 # Make sure an error code is returned when the test fails
9696 /usr/bin/env bash -c ' set -euo pipefail;\
97- ./test/test -v | ./test/greenest.awk '
97+ TESTDIR=./test ./test/test -v | ./test/greenest.awk '
9898
9999test-valgrind : test/test
100- ${VALGRIND} \
100+ TESTDIR=./test ${VALGRIND} \
101101 --suppressions=.valgrind.suppressions \
102102 --leak-check=full \
103103 --show-leak-kinds=definite \
Original file line number Diff line number Diff line change @@ -832,7 +832,7 @@ The body of the notification
832832=item C<category>
833833
834834The category of the notification as defined by the notification spec. See
835- https://specifications.freedesktop.org/notification-spec/latest/ar01s06 .html.
835+ https://specifications.freedesktop.org/notification-spec/latest/categories .html.
836836
837837=item C<desktop_entry>
838838
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ show_help() {
3030 notification with given ID
3131 history-rm ID Remove the notification from
3232 history with given ID.
33- is-paused Check if pause level is greater than 0
33+ is-paused [-e|--exit-code] Check if pause level is greater than 0, optionally with exit code instead of text output
3434 set-paused true|false|toggle Set the pause status
3535 get-pause-level Get the current pause level
3636 set-pause-level level Set the pause level
@@ -117,7 +117,20 @@ case "${1:-}" in
117117 fi
118118 ;;
119119 " is-paused" )
120- property_get paused | ( read -r _ _ paused; printf " %s\n" " ${paused} " ; )
120+ exit=false
121+ case " ${2:- } " in
122+ -e | --exit-code)
123+ exit=true
124+ ;;
125+ esac
126+ property_get paused | {
127+ read -r _ _ paused
128+ if [ " $exit " = " false" ]; then
129+ printf " %s\n" " ${paused} "
130+ elif [ " ${paused} " = " false" ]; then
131+ exit 1
132+ fi
133+ }
121134 ;;
122135 " set-paused" )
123136 [ " ${2:- } " ] \
Original file line number Diff line number Diff line change @@ -33,12 +33,8 @@ SUITE_EXTERN(suite_input);
3333GREATEST_MAIN_DEFS ();
3434
3535int main (int argc , char * argv []) {
36- char * prog = realpath (argv [0 ], NULL );
37- if (!prog ) {
38- fprintf (stderr , "Cannot determine actual path of test executable: %s\n" , strerror (errno ));
39- exit (1 );
40- }
41- base = dirname (prog );
36+ base = getenv ("TESTDIR" );
37+ base = realpath (base ? base : "./test" , NULL );
4238
4339 /* By default do not print out warning messages, when executing tests.
4440 * But allow, if DUNST_TEST_LOG=1 is set in environment. */
@@ -72,10 +68,7 @@ int main(int argc, char *argv[]) {
7268 RUN_SUITE (suite_input );
7369
7470 settings_free (& settings );
75-
76- base = NULL ;
7771 g_strfreev (configs );
78- free (prog );
7972
8073 // this returns the error code
8174 GREATEST_MAIN_END ();
You can’t perform that action at this time.
0 commit comments