aboutsummaryrefslogtreecommitdiffstats
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
* 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>