(t *testing.T)
| 617 | } |
| 618 | |
| 619 | func TestBuildStdin(t *testing.T) { |
| 620 | c := &BuildCommand{ |
| 621 | Meta: TestMetaFile(t), |
| 622 | } |
| 623 | f, err := os.Open(filepath.Join(testFixture("build-only"), "template.json")) |
| 624 | if err != nil { |
| 625 | t.Fatal(err) |
| 626 | } |
| 627 | defer f.Close() |
| 628 | |
| 629 | stdin := os.Stdin |
| 630 | os.Stdin = f |
| 631 | defer func() { os.Stdin = stdin }() |
| 632 | |
| 633 | defer cleanup() |
| 634 | if code := c.Run([]string{"-parallel-builds=1", "-"}); code != 0 { |
| 635 | fatalCommand(t, c.Meta) |
| 636 | } |
| 637 | |
| 638 | for _, f := range []string{"vanilla.txt", "cherry.txt", "chocolate.txt", |
| 639 | "unnamed.txt"} { |
| 640 | if !fileExists(f) { |
| 641 | t.Errorf("Expected to find %s", f) |
| 642 | } |
| 643 | } |
| 644 | } |
| 645 | |
| 646 | func TestBuildOnlyFileMultipleFlags(t *testing.T) { |
| 647 | c := &BuildCommand{ |
nothing calls this directly
no test coverage detected
searching dependent graphs…