aboutsummaryrefslogtreecommitdiff
path: root/tests/git-pre-commit-copyright-check.testscript
diff options
context:
space:
mode:
Diffstat (limited to 'tests/git-pre-commit-copyright-check.testscript')
-rw-r--r--tests/git-pre-commit-copyright-check.testscript25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/git-pre-commit-copyright-check.testscript b/tests/git-pre-commit-copyright-check.testscript
new file mode 100644
index 0000000..f8e51f5
--- /dev/null
+++ b/tests/git-pre-commit-copyright-check.testscript
@@ -0,0 +1,25 @@
+# file : tests/git-pre-commit-copyright-check.testscript
+# license : MIT; see accompanying LICENSE file
+
+.include git-common.testscript git-pre-commit-common.testscript
+
+: basic
+:
+{
+ $clone_prj;
+
+ cat <<EOI >=prj/LICENSE;
+ Copyright (c) 2014-2019 the build2 authors.
+ EOI
+ $ga .;
+
+ $gc 2>>EOE;
+ WARNING: last copyright year in 'LICENSE' is 2019
+ EOE
+
+ date +"%Y" | set year;
+ cat <<"EOI" >=prj/LICENSE;
+ Copyright (c) 2014-$year the build2 authors.
+ EOI
+ $gc
+}