summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/Support/Path.cpp
diff options
context:
space:
mode:
authorSimon Dardis <simon.dardis@imgtec.com>2017-02-22 14:34:45 +0000
committerSimon Dardis <simon.dardis@imgtec.com>2017-02-22 14:34:45 +0000
commite8bb39205dc3053a06ef9a494975586c4be257e0 (patch)
treeac6af92fa691e39a722845403f686051940aca46 /llvm/unittests/Support/Path.cpp
parent4cd211b5dea35cdfcbd476bc60802b60132d8866 (diff)
downloadbcm5719-llvm-e8bb39205dc3053a06ef9a494975586c4be257e0.tar.gz
bcm5719-llvm-e8bb39205dc3053a06ef9a494975586c4be257e0.zip
[Support] XFAIL is_local for mips
is_local can't pass on some our buildbots as some of our buildbots use network shares for building and testing LLVM. llvm-svn: 295840
Diffstat (limited to 'llvm/unittests/Support/Path.cpp')
-rw-r--r--llvm/unittests/Support/Path.cpp36
1 files changed, 36 insertions, 0 deletions
diff --git a/llvm/unittests/Support/Path.cpp b/llvm/unittests/Support/Path.cpp
index df3c5fd0f32..24f16fd1696 100644
--- a/llvm/unittests/Support/Path.cpp
+++ b/llvm/unittests/Support/Path.cpp
@@ -8,12 +8,15 @@
//===----------------------------------------------------------------------===//
#include "llvm/Support/Path.h"
+#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/STLExtras.h"
+#include "llvm/ADT/Triple.h"
#include "llvm/Support/ConvertUTF.h"
#include "llvm/Support/Errc.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/FileUtilities.h"
+#include "llvm/Support/Host.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/raw_ostream.h"
#include "gtest/gtest.h"
@@ -441,6 +444,31 @@ protected:
}
void TearDown() override { ASSERT_NO_ERROR(fs::remove(TestDirectory.str())); }
+
+ SmallVector<Triple::ArchType, 4> UnsupportedArchs;
+ SmallVector<Triple::OSType, 4> UnsupportedOSs;
+ SmallVector<Triple::EnvironmentType, 1> UnsupportedEnvironments;
+
+ bool isUnsupportedOSOrEnvironment() {
+ Triple Host(Triple::normalize(sys::getProcessTriple()));
+
+ if (find(UnsupportedEnvironments, Host.getEnvironment()) !=
+ UnsupportedEnvironments.end())
+ return true;
+
+ if (is_contained(UnsupportedOSs, Host.getOS()))
+ return true;
+
+ if (is_contained(UnsupportedArchs, Host.getArch()))
+ return true;
+
+ return false;
+ }
+
+ FileSystemTest() {
+ UnsupportedArchs.push_back(Triple::mips);
+ UnsupportedArchs.push_back(Triple::mipsel);
+ }
};
TEST_F(FileSystemTest, Unique) {
@@ -1136,7 +1164,15 @@ TEST_F(FileSystemTest, OpenFileForRead) {
::close(FileDescriptor);
}
+#define CHECK_UNSUPPORTED() \
+ do { \
+ if (isUnsupportedOSOrEnvironment()) \
+ return; \
+ } while (0); \
+
TEST_F(FileSystemTest, is_local) {
+ CHECK_UNSUPPORTED();
+
SmallString<128> CurrentPath;
ASSERT_NO_ERROR(fs::current_path(CurrentPath));
OpenPOWER on IntegriCloud