Fix the use of --checkpoint without explicit --checkpoint-action

* src/checkpoint.c (checkpoint_finish_compile): Set default action,
if necessary.
* tests/checkpoint/defaults.at: New testcase.
* tests/checkpoint/dot-compat.at: New testcase.
* tests/checkpoint/dot-int.at: New testcase.
* tests/checkpoint/dot.at: New testcase.
* tests/checkpoint/interval.at: New testcase.
* tests/Makefile.am: Add new testcases.
* tests/testsuite.at Include new testcases.
This commit is contained in:
Sergey Poznyakoff
2019-01-12 10:24:47 +02:00
parent 85c005ee13
commit aa0684ce90
9 changed files with 161 additions and 8 deletions
+25
View File
@@ -0,0 +1,25 @@
# This file is part of GNU tar test suite. -*- Autotest -*-
# Copyright 2019 Free Software Foundation, Inc.
#
# GNU tar is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# GNU tar is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
AT_SETUP([checkpoint defaults])
AT_KEYWORDS([checkpoint checkpoint/defaults])
CPT_CHECK([
tar --checkpoint -c -f ../a.tar .
],
[0],
[],
[tar: Write checkpoint 10
])
AT_CLEANUP
+23
View File
@@ -0,0 +1,23 @@
# This file is part of GNU tar test suite. -*- Autotest -*-
# Copyright 2019 Free Software Foundation, Inc.
#
# GNU tar is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# GNU tar is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
AT_SETUP([dot action (compatibility syntax)])
AT_KEYWORDS([checkpoint checkpoint/dot-compat])
CPT_CHECK([
tar --checkpoint=.2 -c -f ../a.tar .
],
[],
[.....])
AT_CLEANUP
+24
View File
@@ -0,0 +1,24 @@
# This file is part of GNU tar test suite. -*- Autotest -*-
# Copyright 2019 Free Software Foundation, Inc.
#
# GNU tar is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# GNU tar is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
AT_SETUP([dot action and interval])
AT_KEYWORDS([checkpoint checkpoint/dot-int])
CPT_CHECK([
tar --checkpoint-action=dot --checkpoint=2 -c -f ../a.tar .
],
[],
[.....])
AT_CLEANUP
+24
View File
@@ -0,0 +1,24 @@
# This file is part of GNU tar test suite. -*- Autotest -*-
# Copyright 2019 Free Software Foundation, Inc.
#
# GNU tar is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# GNU tar is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
AT_SETUP([dot action])
AT_KEYWORDS([checkpoint checkpoint/dot])
CPT_CHECK([
tar --checkpoint-action=dot -c -f ../a.tar .
],
[],
[.])
AT_CLEANUP
+29
View File
@@ -0,0 +1,29 @@
# This file is part of GNU tar test suite. -*- Autotest -*-
# Copyright 2019 Free Software Foundation, Inc.
#
# GNU tar is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# GNU tar is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
AT_SETUP([checkpoint interval])
AT_KEYWORDS([checkpoint checkpoint/interval])
CPT_CHECK([
tar --checkpoint=2 -c -f ../a.tar .
],
[0],
[],
[tar: Write checkpoint 2
tar: Write checkpoint 4
tar: Write checkpoint 6
tar: Write checkpoint 8
tar: Write checkpoint 10
])
AT_CLEANUP