summaryrefslogtreecommitdiff
path: root/tests/testgtk.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/testgtk.c')
-rw-r--r--tests/testgtk.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/testgtk.c b/tests/testgtk.c
index 2dd73154b..d638c6376 100644
--- a/tests/testgtk.c
+++ b/tests/testgtk.c
@@ -30,7 +30,9 @@
#include <stdlib.h>
#include <string.h>
#include <math.h>
+#include <sys/stat.h>
#include <time.h>
+#include <unistd.h>
#include "gtk.h"
#include "../gdk/gdk.h"
#include "../gdk/gdkx.h"
@@ -8349,11 +8351,22 @@ int
main (int argc, char *argv[])
{
GtkBindingSet *binding_set;
+ struct stat statbuf;
srand (time (NULL));
gtk_set_locale ();
+ /* Check to see if we are being run from the correct
+ * directory.
+ */
+ if (stat("./testgtkrc", &statbuf) < 0)
+ {
+ fprintf (stderr, "*** The testgtk program must be run from within the\n"
+ "*** gtk/ subdirectory of the GTK+ distribution.\n");
+ exit (1);
+ }
+
gtk_rc_add_default_file ("testgtkrc");
gtk_init (&argc, &argv);