[libFuzzer] fail if the corpus dir does not exist

llvm-svn: 259454
This commit is contained in:
Kostya Serebryany 2016-02-02 02:07:26 +00:00
parent e67b402e45
commit 078e984d8d
2 changed files with 4 additions and 1 deletions

View File

@ -32,7 +32,7 @@ static std::vector<std::string> ListFilesInDir(const std::string &Dir,
std::vector<std::string> V;
if (Epoch) {
auto E = GetEpoch(Dir);
if (*Epoch >= E) return V;
if (E && *Epoch >= E) return V;
*Epoch = E;
}
DIR *D = opendir(Dir.c_str());

View File

@ -42,3 +42,6 @@ RUN: not LLVMFuzzer-InitializeTest 2>&1 | FileCheck %s
RUN: LLVMFuzzer-SimpleCmpTest -seed=-1 -runs=0 2>&1 | FileCheck %s --check-prefix=CHECK_SEED_MINUS_ONE
CHECK_SEED_MINUS_ONE: Seed: 4294967295
RUN: not LLVMFuzzer-SimpleTest NONEXISTENT_DIR 2>&1 | FileCheck %s --check-prefix=NONEXISTENT_DIR
NONEXISTENT_DIR: No such directory: NONEXISTENT_DIR; exiting