aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-05-03 15:59:42 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-05-03 15:59:42 +0000
commitf3593eb9fddcb3fa1d60e4676239641c6767e99f (patch)
tree96d8643227700145cadd2e8645eaecf39ab833c4
parent3ebfc4547f21e5fe16986f1c6335fa4343e9a757 (diff)
downloadpaludis-f3593eb9fddcb3fa1d60e4676239641c6767e99f.tar.gz
paludis-f3593eb9fddcb3fa1d60e4676239641c6767e99f.tar.xz
Don't try to run tests that launch sandbox if sandbox is already active
-rw-r--r--paludis/portage_repository_TEST.cc6
-rw-r--r--test/test_framework.cc6
-rw-r--r--test/test_framework.hh8
3 files changed, 20 insertions, 0 deletions
diff --git a/paludis/portage_repository_TEST.cc b/paludis/portage_repository_TEST.cc
index ec3af72..899496a 100644
--- a/paludis/portage_repository_TEST.cc
+++ b/paludis/portage_repository_TEST.cc
@@ -19,6 +19,7 @@
#include <paludis/portage_repository.hh>
#include <paludis/test_environment.hh>
+#include <paludis/util/system.hh>
#include <test/test_framework.hh>
#include <test/test_runner.hh>
@@ -502,6 +503,11 @@ namespace test_cases
{
PortageRepositoryMetadataUncachedTest() : TestCase("metadata uncached") { }
+ bool skip() const
+ {
+ return ! getenv_with_default("SANDBOX_ON", "").empty();
+ }
+
void run()
{
TestEnvironment env;
diff --git a/test/test_framework.cc b/test/test_framework.cc
index d6545f3..06d5733 100644
--- a/test/test_framework.cc
+++ b/test/test_framework.cc
@@ -200,6 +200,12 @@ RunTest::operator() (TestCase * test_case) const
for (int repeat = 0 ; repeat < 2 ; ++repeat)
{
+ if (test_case->skip())
+ {
+ std::cout << "(skip)" << std::endl;
+ break;
+ }
+
if (0 != repeat)
std::cout << " (repeat): " << std::flush;
diff --git a/test/test_framework.hh b/test/test_framework.hh
index 2478a22..33aa95f 100644
--- a/test/test_framework.hh
+++ b/test/test_framework.hh
@@ -117,6 +117,14 @@ namespace test
}
/**
+ * Should we be skipped?
+ */
+ virtual bool skip() const
+ {
+ return false;
+ }
+
+ /**
* After how many seconds should we timeout?
*/
virtual unsigned max_run_time() const