add support for MPL license

This commit is contained in:
Tim Clifford
2020-04-14 21:20:33 +02:00
parent 7c013a14f2
commit fb22319bcc
4 changed files with 31 additions and 3 deletions

View File

@@ -184,3 +184,25 @@ func TestCheckFail(t *testing.T) {
t.Fatalf("TestCheckFail exited with a zero exit code.\n%s", out)
}
}
func TestMPL(t *testing.T) {
if os.Getenv("RUNME") != "" {
main()
return
}
tmp := tempDir(t)
t.Logf("tmp dir: %s", tmp)
samplefile := filepath.Join(tmp, "file.c")
run(t, "cp", "testdata/expected/file.c", samplefile)
cmd := exec.Command(os.Args[0],
"-test.run=TestMPL",
"-l", "mpl", "-c", "Google LLC", "-y", "2018",
"-check", samplefile,
)
cmd.Env = []string{"RUNME=1"}
if out, err := cmd.CombinedOutput(); err != nil {
t.Fatalf("%v\n%s", err, out)
}
}