Blob Blame History Raw
From 28898821ebdacf361ee6b87a49702ff4e94d6110 Mon Sep 17 00:00:00 2001
From: Jakub Filak <jfilak@redhat.com>
Date: Mon, 13 Jul 2015 15:36:20 +0200
Subject: [PATCH] Clearly state that tests cannot be run under root

Related to #1259309

Signed-off-by: Jakub Filak <jfilak@redhat.com>
Signed-off-by: Matej Habrnal <mhabrnal@redhat.com>

Conflicts:
	README
---
 Makefile |  2 +-
 README   | 18 ++++++++++++++++++
 2 files changed, 19 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 2e20217..5c51128 100644
--- a/Makefile
+++ b/Makefile
@@ -60,4 +60,4 @@ distclean:
 
 .PHONY: check
 check: build
-	cd $(OUT_DIR) && make test
+	if [ "_0" != "_$$(id -u)" ]; then cd $(OUT_DIR) && make test; else echo "Cannot run tests under root user."; exit 1; fi
diff --git a/README b/README
index 590db7e..abbf3aa 100644
--- a/README
+++ b/README
@@ -86,3 +86,21 @@ $  java -agentlib:abrt-java-connector=executable=threadclass $MyClass -platform.
 
 - 'mainclass' is used when 'executable' option is not passed and 'executable'
   file is filled with full path $MyClass
+
+Building from sources
+---------------------
+
+This project uses CMake build system but a Makefile for GNU Make, which defines
+all the targets you usually need to run, is also provided.
+
+$ make build
+$ make run
+$ make check
+$ make rpm
+$ make distclean
+
+All build results are stored in ./bin directory.
+
+The `check' make target will fail if you run it under root user. There are some
+test cases that try to generate 'File Access Denied' exceptions and the easiest
+way to achieve that is to try to access a root's file.
-- 
1.8.3.1