1# Uses echo in a way that is not supported by the iOS "run-on-device" script.
2UNSUPPORTED: ios
3
4RUN: %cpp_compiler %S/SimpleTest.cpp -o %t-SimpleTest
5
6USE-1: INFO: seed corpus: files: 1
7RUN: echo -n "%t-SimpleTest" > %t.seed-inputs
8# Test both formats of -seed_inputs argument.
9RUN: %run %t-SimpleTest -runs=1 -seed_inputs=@%t.seed-inputs 2>&1 | FileCheck %s --check-prefix=USE-1
10RUN: %run %t-SimpleTest -runs=1 -seed_inputs=%t-SimpleTest 2>&1 | FileCheck %s --check-prefix=USE-1
11
12USE-2: INFO: seed corpus: files: 2
13RUN: echo -n "%t-SimpleTest,%t-SimpleTest" > %t.seed-inputs
14RUN: %run %t-SimpleTest -runs=1 -seed_inputs=@%t.seed-inputs 2>&1 | FileCheck %s --check-prefix=USE-2
15RUN: %run %t-SimpleTest -runs=1 -seed_inputs=%t-SimpleTest,%t-SimpleTest 2>&1 | FileCheck %s --check-prefix=USE-2
16
17# Test that missing files and trailing commas are tolerated.
18RUN: echo -n "%t-SimpleTest,%t-SimpleTest,nonexistent-file," > %t.seed-inputs
19RUN: %run %t-SimpleTest -runs=1 -seed_inputs=@%t.seed-inputs 2>&1 | FileCheck %s --check-prefix=USE-2
20RUN: %run %t-SimpleTest -runs=1 -seed_inputs=%t-SimpleTest,%t-SimpleTest,nonexistent-file, 2>&1 | FileCheck %s --check-prefix=USE-2
21
22# Test that using a non existent file or an empty seed list fails.
23EMPTY: seed_inputs is empty or @file does not exist.
24RUN: not %run %t-SimpleTest -runs=1 -seed_inputs=@nonexistent-file 2>&1 | FileCheck %s --check-prefix=EMPTY
25RUN: echo -n "" > %t.seed-inputs
26RUN: not %run %t-SimpleTest -runs=1 -seed_inputs=@%t.seed-inputs 2>&1 | FileCheck %s --check-prefix=EMPTY
27RUN: not %run %t-SimpleTest -runs=1 -seed_inputs= 2>&1 | FileCheck %s --check-prefix=EMPTY
28