From 52c5da997b9b023544e8867e818e9b1f9616e990 Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Sat, 5 Aug 2017 11:02:00 +0200 Subject: [PATCH] Add CI test for manpages --- run_integration_tests.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/run_integration_tests.go b/run_integration_tests.go index 0ee48f111..855fe05e4 100644 --- a/run_integration_tests.go +++ b/run_integration_tests.go @@ -208,6 +208,7 @@ func (env *TravisEnvironment) RunTests() error { return err } + // check for forbidden imports deps, err := findImports() if err != nil { return err @@ -227,6 +228,20 @@ func (env *TravisEnvironment) RunTests() error { return errors.New("CI: forbidden imports found") } + // check that the man pages are up to date + manpath := filepath.Join("doc", "new-man") + if err := os.MkdirAll(manpath, 0755); err != nil { + return err + } + + if err := run("./restic", "manpage", "--output-dir", manpath); err != nil { + return err + } + + if err := run("diff", "-aur", filepath.Join("doc/man"), manpath); err != nil { + return fmt.Errorf("========== man pages are not up to date\nplease run `restic manpage --output-dir doc/man`\n%v", err) + } + return nil }