SummaryRefsLogTreeCommitDiffStats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* test: demonstrate incorrect -s option on mcron programDale Mellor2020-04-201-0/+82
| | | | | | | | | | The option is supposed to be able to take an optional argument, but if the argument is not supplied (should default to 8) then the test, rather than failing, is skipped with a friendly message in the log file. The proper fix will come with an upstream patch to GNU Guile, and a future version of Mcron. * tests/schedule-2.sh: new test, new file * Makefile.am: make sure to run the new test file
* test: Demonstration of failure to open local file.Dale Mellor2020-04-201-0/+3
| | | | | | | | The mcron program goes looking for files specified on the command line in Guile's module path, inevitably resulting in failure to load said file. Running 'make check' will show at least one failure. * tests/basic.sh: Added new test.
* test: make date tests reliable, i.e. independent of current timeDale Mellor2020-04-202-18/+17
| | | | | | | | | | Some of the date tests depend both on the particular time of day and year at which the test is run, and also on the state of daylight-savings adjustments. (At the present time on my system there are four failing tests, but YMMV.) This patch puts all the tests to UTC time in the C locale, making the results consistent. *All* items in the test suite should be passing once again. * tests/job-schedule.scm: Fix up the environment before running the tests.
* tests: Add "tests/vixie-time.scm"Mathieu Lirzin2018-04-081-0/+118
| | | | | * tests/vixie-time.scm: New test. * Makefile.am (TESTS): Add it.
* utils: Check 'show-version' and 'show-package-information'Mathieu Lirzin2018-03-271-0/+18
| | | | | * tests/utils.scm ("show-package-information") ("show-version"): New tests.
* job-specifier: Check 'job'Mathieu Lirzin2018-03-271-0/+37
| | | | | | | | * tests/job-specifier.scm ("job: procedure timeproc") ("job: list timeproc", "job: string timeproc", "job: list action") ("job: invalid string timeproc", "job: invalid timeproc") ("job: procedure action", "job: string action") ("job: user name"): New tests.
* job-specifier: Box 'configuration-user' global variableMathieu Lirzin2018-03-271-0/+46
| | | | | | | | | | | * src/mcron/job-specifier.scm (configuration-user): Box it using SRFI-111 to be explicit about the mutability of this object. (job): Adapt. (set-configuration-user): Adapt and use 'get-user'. * tests/job-specifier.scm ("set-configuration-user: passwd entry") ("set-configuration-user: invalid uid", "set-configuration-user: uid") ("set-configuration-user: invalid spec") ("set-configuration-user: name"): New tests.
* job-specifier: Check 'next-...' proceduresMathieu Lirzin2018-03-271-3/+36
| | | | | | * tests/job-specifier.scm ("next-year", "next-month", "next-day") ("next-hour", "next-minute", "next-second"): New tests. ("next-hour-from"): Remove.
* base: Check how child processes are handledMathieu Lirzin2018-03-261-6/+23
| | | | | * tests/base.scm ("run-job: basic"): Check the number of children too. ("child-cleanup: one", "update-number-children!: set value"): New tests.
* job-specifier: Adapt 'bump-time' to 'next-...-from' proceduresMathieu Lirzin2018-03-261-0/+4
| | | | | | | | | | | | | | | This is a follow-up to commit 913e3c65e4f56476e8ac69f4892cf92c125751ec. Since 'next-...-from' procedures now uses an '#:optional' argument instead of a dotted optional arguments list, 'bump-time' doesn't need to unwrap VALUE-LIST anymore. * src/mcron/job-specifier.scm (bump-time): Pass VALUE-LIST directly to '%find-best-next'. * tests/job-specifier.scm ("next-hour-from"): New test. * NEWS: Update. Reported-by: Ludovic Courtès <ludo@gnu.org>
* job-specifier: Preserve '%find-best-next' arguments exactnessMathieu Lirzin2018-03-261-1/+10
| | | | | | | | | | | | The behavior of the 'min' procedure which converts its parameters to inexact numbers when at least one of them is inexact was causing '%find-best-next' to always return real numbers. * src/mcron/job-specifier.scm (%find-best-next): Preserve the exactness of numbers in NEXT-LIST. * tests/job-specifier.scm ("%find-best-next: exact"): New test. Reported-by: Ludovic Courtès <ludo@gnu.org>
* utils: Check 'mcron-error'Mathieu Lirzin2018-03-251-1/+43
| | | | | * tests/utils.scm ("mcron-error: exit code", "mcron-error: output") ("mcron-error: output no-exit", "mcron-error: only stderr"): New tests.
* tests: Add "tests/utils.scm"Mathieu Lirzin2018-03-251-0/+51
| | | | | * tests/utils.scm: New test. * Makefile.am (TESTS): Add it.
* tests: Remove unused schedule stubsMathieu Lirzin2018-03-241-13/+12
| | | | | | * tests/base.scm ("number-children: init") ("update-number-children!: 1+", "update-number-children!: 1-"): Remove 'let' form defining the schedule stub.
* environment: Check configuration environmentMathieu Lirzin2018-03-241-1/+54
| | | | | | | * tests/environment.scm ("current-environment-mods-copy: empty") ("current-environment-mods: init", "append-environment-mods: basic") ("append-environment-mods: twice", "clear-environment-mods: effect") ("current-environment-mods-copy: basic"): New tests.
* base: Check 'run-job'Mathieu Lirzin2018-03-241-0/+16
| | | | * tests/base.scm ("run-job: basic"): New test.
* base: Box 'number-children'Mathieu Lirzin2018-03-241-0/+32
| | | | | | | | | * src/mcron/base.scm (number-children): Box it using SRFI-111 to be explicit about the mutability of this object. (update-number-children!): New procedure. (run-job, child-cleanup): Use it. * tests/base.scm ("update-number-children!: 1+") ("number-children: init", "update-number-children!: 1-"): New tests.
* tests: Add "tests/base.scm"Mathieu Lirzin2018-03-241-0/+151
| | | | | * tests/base.scm: New test. * Makefile.am (TESTS): Add it.
* utils: Use 'scandir' instead of custom 'for-each-file'Mathieu Lirzin2018-03-201-13/+13
| | | | | | | | | | | | * src/mcron/utils.scm (for-each-file): Delete. * src/mcron/scripts/cron.scm (process-files-in-system-directory): Use 'scandir' which has the benefit of being deterministic. * src/mcron/scripts/mcron.scm (process-files-in-user-directory): Likewise. * tests/schedule.sh: Update expected output which is now more reliable. * NEWS: Update. Suggested-by: Ludovic Courtès <ludo@gnu.org>
* tests: Set timezone in "schedule.sh"Mathieu Lirzin2018-03-201-21/+26
| | | | | | | | | | Previously the test environment was implicitly expecting the current timezone to be UTC+1. * tests/schedule.sh: Set TZ environment variable to 'UTC0'. Update expected result. Reported-by: Ludovic Courtès <ludo@gnu.org>
* tests: Add 'schedule.sh'Mathieu Lirzin2018-03-161-0/+123
| | | | | | | * tests/schedule.sh: New test. * Makefile.am (TESTS): Add it. * src/mcron/job-specifier.scm (configuration-time): Use SOURCE_DATE_EPOCH for reproducible tests.
* tests: Add 'basic.sh'Mathieu Lirzin2017-09-282-0/+638
| | | | | | | | | | * tests/init.sh: New test framework from Gnulib. * tests/basic.sh: New test. * Makefile.am (TESTS): Add it. (TEST_EXTENSIONS): Add '.sh'. (SH_LOG_COMPILER): Use 'pre-inst-env'. (EXTRA_DIST): Add 'tests/init.sh'. * build-aux/pre-inst-env.in: export $srcdir for shell tests.
* environment: modify-environment: Add tests.Mathieu Lirzin2016-12-011-0/+39
| | | | | * tests/environment.scm: New test. * Makefile.am (TESTS): Add it.
* job-specifier: range: Add tests.Mathieu Lirzin2016-12-011-0/+43
* build-aux/test-driver.scm: New script. * configure.ac (AC_REQUIRE_AUX_FILE): Add it. * tests/job-specifier.scm: New test. * Makefile.am (TEST_EXTENSIONS, AM_TESTS_ENVIRONMENT, SCM_LOG_DRIVER) (TESTS): New variables. (EXTRA_DIST): Update. * .gitignore: Likewise.