summaryrefslogtreecommitdiffstats
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
* Handle dates past January 19th, 2038Lukas Fleischer2015-02-072-0/+31
| | | | | | Try to support dates past year 2038 on systems with 64-bit time_t. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* test/data/ical-006.ical: Remove timezonesLukas Fleischer2014-08-181-12/+12
| | | | | | | This are neither needed for the tests nor supported by the iCal import. Reported-by: Håkan Jerning <jerning@home.se> Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* test/Makefile.am: Add missing testLukas Fleischer2014-08-181-0/+2
| | | | | | | We added ical-005 in f3fe3c8 (Gracefully handle all day events in iCal imports, 2014-08-18) but forgot to add entries to the Makefile. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* Correctly parse all types of iCal durationsLukas Fleischer2014-08-183-0/+108
| | | | | | | | This was supposed to be fixed in 6ca2535 (ical.c: Simplify and fix ical_durtime2long(), 2014-07-28) but some cases were not covered. Reported-by: Håkan Jerning <jerning@home.se> Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* Gracefully handle all day events in iCal importsLukas Fleischer2014-08-182-0/+49
| | | | | | | | | Do not create two events when importing an event that lasts an entire day. Reported-by: Jörn Tillmanns <tillmanns@tuxzone.org> Reported-by: Håkan Jerning <jerning@home.se> Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* Handle CRLF line endings in iCal filesLukas Fleischer2014-08-183-0/+42
| | | | | | | | RFC 2445 mentions that CRLF line endings may be used in iCal files. Handle them properly when importing. Reported-by: Håkan Jerning <jerning@home.se> Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* test/: Fix date in ical-001Lukas Fleischer2014-08-182-4/+4
| | | | Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* Use backwards-compatible out format for queriesLukas Fleischer2014-08-063-0/+38
| | | | | | | | | | | Print TODO items before appointments in query outputs and add an empty line between the list of TODO items and the list of appointments. This is how items were printed before the big parser refactoring. Also, add a test to ensure we do not unintentionally change that format in the future. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* tests/: Add basic iCal import testsLukas Fleischer2014-07-287-0/+267
| | | | | | | | Tests ical-002.sh and ical-003.sh currently fail due to bugs in duration and exception parsing. Reported-by: Håkan Jerning <jerning@home.se> Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* test/: Remove temporary errors file in testsLukas Fleischer2014-07-0820-0/+20
| | | | Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* test/Makefile.am: Add missing test dataLukas Fleischer2014-07-081-0/+27
| | | | Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* Implement test initialization properlyLukas Fleischer2014-07-0849-49/+52
| | | | | | | Make test-init.sh work even if tests are executed from another directory. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* Use tabs instead of spaces for indentationLukas Fleischer2013-04-141-149/+152
| | | | | | | | | | | This completes our switch to the Linux kernel coding style. Note that we still use deeply nested constructs at some places which need to be fixed up later. Converted using the `Lindent` script from the Linux kernel code base, along with some manual fixes. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* test/: Add default values for configuration variablesLukas Fleischer2013-02-2750-7/+102
| | | | | | | | | | | Add a small helper script called "test-init.sh" that is sourced in each test case and initializes the CALCURSE and DATA_DIR environment variables. Update the test suite README to point out that setting these environment variables is no longer required. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* test/: Add a couple of black-box tests for itemsLukas Fleischer2013-02-2755-0/+251
| | | | | | | This introduces five test suite failures which will be fixed in one of the following patches. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* Update copyright rangesLukas Fleischer2013-02-041-1/+1
| | | | | | | Add 2013 to the copyright range for all source and documentation files. Reported-by: Frederic Culot <frederic@culot.org> Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* test/: Use `faketime -f`Lukas Fleischer2012-12-227-7/+11
| | | | | | | | | | | | Use the advanced timestamp specification format for libfaketime. Before using that, some tests failed on 32-bit systems due to integer overflows. It seems like faketime translates absolute dates to relative dates by default. Moreover, libfaketime is not able to handle relative dates that exceed the maximum value of a signed integer. Using "-f" skips the conversion to relative dates. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* test/: Do not error out if libfaketime is missingLukas Fleischer2012-12-228-8/+8
| | | | | | | | If the faketime library is missing, show a warning and skip the test. However, do not error out to make sure the test suite is able to terminate successfully on systems without libfaketime. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* test/Makefile.am: Add missing files to EXTRA_DISTLukas Fleischer2012-12-051-1/+7
| | | | Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* run-test.c: Return failure if actual output is too shortLukas Fleischer2012-11-261-0/+3
| | | | | | | | | | | | | | We always terminated run-test when reached the end of the expected output and returned success if actual output and expected output were the same up to this point. This resulted in run-test always returning successfully if the actual output was a prefix of the expected output, even if it was a proper prefix. Check if the expected output contains more data after string comparison has finished to ensure we only return successfully if both outputs are actually equal. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* test/: Add a couple of tests for recurrent itemsLukas Fleischer2012-11-267-1/+135
| | | | | | | | | | | | | This adds tests for following features/scenarios: * Recurrent appointments and events of all (repetition) types. * Recurrent appointments with a duration of more than 24 hours. * Overlapping recurrent appointments. * Recurrent items and leap years. * Recurrent items with an end date. * Recurrent items with exceptions. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* Add a test case to reproduce BUG#2Lukas Fleischer2012-06-303-1/+20
| | | | Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* test/data/apts: Add a fair bit of items to 01/01/1902Lukas Fleischer2012-06-301-0/+141
| | | | | | | This might turn out to be useful if we want to do performance tests and check what happens if a day with a large amount of items is processed. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* test/data/conf: Update with recent changesLukas Fleischer2012-05-311-1/+1
| | | | | | | | | Update the value of "appearance.calendarview" used in the default configuration file of our test suite (we now use "monthly"/"weekly" instead of integer values). Late fix for what we broke in commit 2c5235cca70bf1c5b5e92dd5b6b178ab13b695f2. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* Switch to Linux kernel coding styleLukas Fleischer2012-05-211-117/+94
| | | | | | | | | | | | | | Convert our code base to adhere to Linux kernel coding style using Lindent, with the following exceptions: * Use spaces, instead of tabs, for indentation. * Use 2-character indentations (instead of 8 characters). Rationale: We currently have too much levels of indentation. Using 8-character tabs would make huge code parts unreadable. These need to be cleaned up before we can switch to 8 characters. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* Fix data type of "general.firstdayofweek"Lukas Fleischer2012-05-171-1/+1
| | | | | | | | | | | This option wasn't converted to a proper data type when it was renamed from "week_begins_on_monday" to "general.firstdayofweek". Convert the boolean option into an enumeration type that can take the values "monday" and "sunday". Also, update the documentation, add a conversion rule to the upgrade script and convert the configuration file used in the test suite. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* test/: Add a READMELukas Fleischer2012-04-171-0/+121
| | | | | | Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de> Signed-off-by: Frederic Culot <frederic@culot.org> Signed-off-by: Erik Saule <esaule@bmi.osu.edu>
* test/data/conf: Update variable namesLukas Fleischer2012-03-291-22/+22
| | | | | | | Update the default configuration file used in our test suite to match the new configuration variable naming scheme. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* Update copyright rangesLukas Fleischer2012-03-261-1/+1
| | | | | | Add 2012 to the copyright range for all source and documentation files. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* test/: Run calcurse in read-only modeLukas Fleischer2012-02-2412-14/+15
| | | | | | | | We don't change any configuration nor do we modify items here, so we can safely invoke calcurse in read-only mode. Fixes a couple of permission errors seen with `make distcheck`. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* test/: Use correct calcurse binary and data dirLukas Fleischer2012-02-2413-17/+21
| | | | | | | | | | We really don't want to use the calcurse(1) binary from "$PATH" here. Introduce an environment variable "$CALCURSE" which can be used specify the binary to use and set this variable to the binary located in the build directory by default. Similarly, add another environment variable "$DATA_DIR" that can be used to specify a data directory. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* test/Makefile.am: Add tests to "EXTRA_DIST"Lukas Fleischer2012-02-241-0/+1
| | | | | | | | Add tests and the dummy data directory to "EXTRA_DIST" since we want these to be shipped in distribution tarballs. Spotted with `make distcheck`. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* {src,test}/Makefile.am: Enable pedantic warningsLukas Fleischer2012-02-191-0/+2
| | | | | | | | Now that we're fully POSIX compliant and fixed up some minor issues with ISO C99, use "-std=c99 -pedantic -D_POSIX_C_SOURCE=200809L" as default build flags for calcurse and the test suite. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* test/run-test.c: Check fgets() return value properlyLukas Fleischer2012-02-191-2/+2
| | | | | | | Not sure what we were doing here. fgets() returns a pointer, not an integer! Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* test/: Add test case for "-S" (pattern search)Lukas Fleischer2012-01-222-1/+27
| | | | | | | * search-001.sh: Compare the output of "-S <regex>" (using a regular expression) with hardcoded data. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* test/: Add test cases for "-a" and "-n"Lukas Fleischer2012-01-223-1/+39
| | | | | | | * appointment-001.sh: Compare output of "-a" with hardcoded data. * next-001.sh: Compare output of "-n" with hardcoded data. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* test/: Add test cases for "-d" and "-s"/"-r"Lukas Fleischer2012-01-228-1/+804
| | | | | | | | | | | * day-001.sh: Compare output of "-d<date>" with hardcoded data. * day-002.sh: Compare output of "-d<num>" with hardcoded data. * day-003.sh: Compare output of "-d<num>" with "-s<date> -r<num>". * range-001.sh: Compare output of "-r" with hardcoded data. * range-002.sh: Compare output of "-r<num>" with hardcoded data. * range-003.sh: Compare output of "-r<num>" with "-s<date> -r<num>". Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* test/: Add generic tests for todo operationsLukas Fleischer2012-01-225-1/+235
| | | | | | | | | | | * todo-001.sh: Tests the "-t" command line option (calculates expected output by parsing the todo data file). * todo-002.sh: Tests "-t<num>" in a way similar to todo-001.sh. * todo-003.sh: Tests "-t0" in a way similar to todo-001.sh. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* test/: Add three basic self testsLukas Fleischer2012-01-224-0/+25
| | | | | | | | | | | | | | | * true-001.sh: Always returns true - this should never ever fail. * run-test-001.sh: Invokes run-test, passing itself as a parameter. Subsequently, it outputs the very same (hardcoded) expected and actual values. * run-test-002.sh: Tests run-test's negative assertion feature in a way similar to run-test-001.sh. However, output different (hardcoded) expected and actual values and invoke run-test with the negative test prefix ('!'). Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* test/: Add initial configuration fileLukas Fleischer2012-01-221-0/+75
| | | | | | As a preparation for our test cases (needed for date formatting etc.) Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* test/run-test.c: Support negative assertionsLukas Fleischer2012-01-211-3/+14
| | | | | | | | | | | Sometimes, we might want to make negative assertions (tests where expected and actual output are expected/known to be different). A test can be marked negative by prefixing it with an exclamation mark ('!'): $ ./run-test !test-negative Running test-negative... ok Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
* Add a minimal test suiteLukas Fleischer2012-01-212-0/+247
Introduce a new "test/" sub-directory that contains tests for calcurse. Right now, it only includes the quick-and-dirty "run-test" helper that can be used to run and verify tests: $ ./run-test test-1 test-2 test-3 test-4 Running test-1... ok Running test-2... ok Running test-3... FAIL Each argument passed to run-test must be a test script located in the current directory. run-test invokes each script twice and passes the command line argument "expected" and "actual", respectively. A test case succeeds if both "expected" and "actual" instances return with a zero exit status and produce exactly the same output. It fails otherwise. run-test terminates with a non-zero exit status as soon as one of the test fails. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>