### Install Taskwarrior PDF Documentation Source: https://github.com/gothenburgbitfactory/taskwarrior/blob/develop/doc/CMakeLists.txt Installs the Taskwarrior PDF documentation file to the destination specified by TASK_DOCDIR. ```cmake install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/ref/task-ref.pdf DESTINATION ${TASK_DOCDIR}) ``` -------------------------------- ### Install Task Executable Source: https://github.com/gothenburgbitfactory/taskwarrior/blob/develop/src/CMakeLists.txt Installs the 'task_executable' target to the specified binary directory. ```cmake install (TARGETS task_executable DESTINATION ${TASK_BINDIR}) ``` -------------------------------- ### Install and Set Up Pre-commit Hooks Source: https://github.com/gothenburgbitfactory/taskwarrior/blob/develop/doc/devel/contrib/coding_style.md Install pre-commit and set up the git hooks to ensure consistent code formatting. This should be run locally to apply clang-format and black. ```python pip install pre-commit pre-commit install ``` -------------------------------- ### Install Scripts and Completions Source: https://github.com/gothenburgbitfactory/taskwarrior/blob/develop/scripts/CMakeLists.txt Defines installation rules for various script and completion files, including bash, vim, hooks, fish, and zsh. ```cmake install (DIRECTORY bash vim hooks DESTINATION ${TASK_DOCDIR}/scripts) ``` ```cmake install (FILES fish/task.fish DESTINATION ${FISH_COMPLETIONSDIR}) ``` ```cmake install (FILES zsh/_task DESTINATION share/zsh/site-functions) ``` ```cmake install (DIRECTORY add-ons DESTINATION ${TASK_DOCDIR}/scripts FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) ``` -------------------------------- ### Install Taskwarrior Configuration Directory Source: https://github.com/gothenburgbitfactory/taskwarrior/blob/develop/doc/CMakeLists.txt Installs the Taskwarrior configuration directory from the source tree to the destination specified by TASK_RCDIR. ```cmake install (DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/rc/ DESTINATION ${TASK_RCDIR}) ``` -------------------------------- ### Configure and Install Man Pages Source: https://github.com/gothenburgbitfactory/taskwarrior/blob/develop/doc/CMakeLists.txt This CMake script configures and installs man pages for Taskwarrior. It iterates through a list of man files, configures them using templates, and installs them to the appropriate directories based on file type. ```cmake cmake_minimum_required (VERSION 3.22...4.0) message ("-- Configuring man pages") set (man_FILES task-color.5 task-sync.5 taskrc.5 task.1) foreach (man_FILE ${man_FILES}) configure_file ( man/${man_FILE}.in man/${man_FILE}) endforeach (man_FILE) install (DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/man/ DESTINATION ${TASK_MAN1DIR} FILES_MATCHING PATTERN "*.1") install (DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/man/ DESTINATION ${TASK_MAN5DIR} FILES_MATCHING PATTERN "*.5") ``` -------------------------------- ### Taskwarrior DOM Reference Examples Source: https://github.com/gothenburgbitfactory/taskwarrior/blob/develop/doc/devel/rfcs/rules.md Provides examples of DOM references, including attribute access with optional sub-references and formats, and higher-level constructs. ```text dom . [ .] [. ] . ``` ```text dom . 123 . entry . year . yyyy ``` ```text dom . 123 . entry ``` ```text dom . 123 . tags ``` ```text dom . 123 . tags . count ``` ```text dom . 123 . tags . 1 ``` ```text dom.rc. ``` ```text dom.cli.args ``` ```text dom.terminal.width ``` ```text dom.terminal.height ``` ```text dom.system.version ``` ```text dom.system.oѕ ``` ```text dom.active Boolean indicator of any active tasks ``` ```text dom.synced Boolean indicator of the need to sync ``` ```text dom.rc.path String path of .taskrc file (or override) ``` ```text dom.data.path String path of data directory ``` ```text dom.hooks.path String path of hooks directory ``` ```text dom.state.program ``` ```text dom.state.sync.last ``` ```text dom.state.sync.configured ``` ```text dom.state.run.last ``` ```text dom.state.context ``` -------------------------------- ### Sync Request Message Example Source: https://github.com/gothenburgbitfactory/taskwarrior/blob/develop/doc/devel/rfcs/request.md This is an example of a client-initiated sync request message. It includes required headers and a payload containing a sync key followed by JSON-formatted tasks. ```text type: sync org: user: key: client: task 2.3.0 protocol: v1 2e4685f8-34bc-4f9b-b7ed-399388e182e1 {"description":"Test data","entry":"20130602T002341Z","status":"pending"} ``` -------------------------------- ### Sync Response Message Example Source: https://github.com/gothenburgbitfactory/taskwarrior/blob/develop/doc/devel/rfcs/request.md An example of a server response to a sync request. It indicates success and may contain remote task modifications and a new sync key. ```text type: response client: taskd 1.0.0 protocol: v1 code: 200 status: Ok 45da7110-1bcc-4318-d33e-12267a774e0f ``` -------------------------------- ### Two Branch Case Example Source: https://github.com/gothenburgbitfactory/taskwarrior/blob/develop/doc/devel/rfcs/sync.md Demonstrates the calculation of deltas and the resulting merged task in a two-branch scenario where changes occur on both client and server. ```text T0 project:ONE due:tomorrow priority:H +tag1 Original description ``` ```text T1 project:TWO due:23rd priority:H +tag1 Original description ``` ```text T2 project:ONE due:tomorrow priority:H +tag1 Modified description ``` ```text T0 project:ONE due:tomorrow priority:H +tag1 Original description T1 project:TWO due:23rd priority:H +tag1 Original description ---------------------------------------------------------------------- d1 project:TWO due:23rd ``` ```text T0 project:ONE due:tomorrow priority:H +tag1 Original description T2 project:ONE due:tomorrow priority:H +tag1 Modified description ---------------------------------------------------------------------- d2 Modified description ``` ```text T3 = T0 + d1 + d2 = T0 + (project:TWO due:23rd) + (Modified description) T3 = project:TWO due:23rd priority:H +tag1 Modified description ``` -------------------------------- ### Taskwarrior Integer Format Example Source: https://github.com/gothenburgbitfactory/taskwarrior/blob/develop/doc/devel/rfcs/task.md Shows the standard representation for integer values in Taskwarrior. ```text 123 ``` -------------------------------- ### Hierarchical Project Example Source: https://github.com/gothenburgbitfactory/taskwarrior/blob/develop/doc/devel/rfcs/task.md When a dot (".") is used in the project name, it signifies a sub-project relationship. For example, 'Home.Kitchen' and 'Home.Garden' are both considered part of the 'Home' project. ```json "Home.Kitchen" ``` ```json "Home.Garden" ``` -------------------------------- ### Example Taskserver Message Format Source: https://github.com/gothenburgbitfactory/taskwarrior/blob/develop/doc/devel/rfcs/request.md Illustrates the basic structure of a Taskserver message, including the size, header, and payload sections. ```text name: value name2: value2 payload ``` -------------------------------- ### Taskwarrior Date Format Example (ISO 8601 UTC) Source: https://github.com/gothenburgbitfactory/taskwarrior/blob/develop/doc/devel/rfcs/task.md Provides an example of the ISO 8601 combined date and time format in UTC, as used for date values in Taskwarrior. ```text 20120110T231200Z ``` -------------------------------- ### System Corrosion Find Package Source: https://github.com/gothenburgbitfactory/taskwarrior/blob/develop/src/taskchampion-cpp/CMakeLists.txt Configures CMake to use a system-provided Corrosion installation. Ensures 'find_package' is used without a FetchContent fallback. ```cmake set(CMAKE_REQUIRE_FIND_PACKAGE_Corrosion ON) find_package(Corrosion REQUIRED) ``` -------------------------------- ### Taskwarrior JSON Object Example Source: https://github.com/gothenburgbitfactory/taskwarrior/blob/develop/doc/devel/rfcs/task.md Illustrates the basic structure of a Taskwarrior JSON object, which is a single line of text terminated by a line feed. Note that this is a simplified example and may be missing required fields for a valid task. ```json {"description":"One two three","status":"pending", ... } ``` -------------------------------- ### Taskwarrior Duration Format Examples Source: https://github.com/gothenburgbitfactory/taskwarrior/blob/develop/doc/devel/rfcs/task.md Illustrates various valid formats for duration values in Taskwarrior, which can include a sign, number, and unit. ```text -3days ``` ```text annual ``` ```text 4hrs ``` -------------------------------- ### Add Periodic Task Template Source: https://github.com/gothenburgbitfactory/taskwarrior/blob/develop/doc/devel/rfcs/recurrence.md Example of adding a new periodic template with due date, recurrence interval, wait, scheduled, and until dates. This sets up the initial state for recurring tasks. ```bash task add ... due:D recur:R wait:D-1wk scheduled:D-1wk until:U ``` -------------------------------- ### Representing a Change Sequence Source: https://github.com/gothenburgbitfactory/taskwarrior/blob/develop/doc/devel/rfcs/sync.md Illustrates the representation of a sequence of changes to a single task, starting from a base state T0. ```text T0 --> T1 --> T2 ``` -------------------------------- ### Use Case 1: New Local Task Source: https://github.com/gothenburgbitfactory/taskwarrior/blob/develop/doc/devel/rfcs/sync.md Illustrates the initial synchronization when a new task is created locally and the server is empty. ```text Server: - Client: T0 ``` ```text Server: T0 Client: T0 ``` -------------------------------- ### Clone and Build Taskwarrior Source: https://github.com/gothenburgbitfactory/taskwarrior/blob/develop/doc/devel/contrib/development.md Basic steps to clone the repository, initialize submodules, and build the project using CMake. Use 'RelWithDebInfo' for a balance of optimization and debugging information. ```sh git clone https://github.com/GothenburgBitFactory/taskwarrior cd taskwarrior git submodule init git submodule update cmake -S . -B build -DCMAKE_BUILD_TYPE=RelWithDebInfo cmake --build build ``` -------------------------------- ### Initialize Corrosion FetchContent Source: https://github.com/gothenburgbitfactory/taskwarrior/blob/develop/src/taskchampion-cpp/CMakeLists.txt Configures Corrosion to be fetched using FetchContent, specifying the Git repository and tag. This is used when not using a submodule or system-provided Corrosion. ```cmake FetchContent_Declare(Corrosion GIT_REPOSITORY https://github.com/corrosion-rs/corrosion.git GIT_TAG ${TASK_CORROSION_VERSION} FIND_PACKAGE_ARGS CONFIG ) FetchContent_MakeAvailable(Corrosion) ``` -------------------------------- ### Statistics Response Message Example Source: https://github.com/gothenburgbitfactory/taskwarrior/blob/develop/doc/devel/rfcs/request.md An example of a server response to a statistics request. The results are contained within the header variables, and new values may be added over time. ```text type: response client: taskd 1.0.0 protocol: v1 code: 200 status: Ok average request bytes: 0 average response bytes: 0 average response time: 0.000000 errors: 0 idle: 1.000000 maximum response time: 0.000000 total bytes in: 0 total bytes out: 0 tps: 0.000000 transactions: 1 uptime: 28 ``` -------------------------------- ### Taskserver Reference Implementation Files Source: https://github.com/gothenburgbitfactory/taskwarrior/blob/develop/doc/devel/rfcs/client.md Lists files related to the Taskserver reference implementation for SSL/TLS client and server communication. ```makefile taskd.git/src/tls/Makefile # To build the example taskd.git/src/tls/README # How to run the example taskd.git/src/tls/TLSClient.cpp # TLS client code taskd.git/src/tls/TLSClient.h taskd.git/src/tls/TLSServer.cpp # TLS Server code taskd.git/src/tls/TLSServer.h taskd.git/src/tls/c.cpp # Client program taskd.git/src/tls/s.cpp # Server program taskd.git/src/tls/text.cpp # Text manipulation taskd.git/src/tls/text.h # Text manipulation ``` -------------------------------- ### Taskwarrior Reference Implementation Files Source: https://github.com/gothenburgbitfactory/taskwarrior/blob/develop/doc/devel/rfcs/client.md Lists files related to the Taskwarrior reference implementation, including TLS client code and sync implementation. ```cpp task.git/src/TLSClient.cpp # TLS client code task.git/src/TLSClient.h task.git/src/commands/CmdSync.cpp # Sync implementation task.git/src/commands/CmdSync.h ``` -------------------------------- ### Find PkgConfig and Fish Completions Source: https://github.com/gothenburgbitfactory/taskwarrior/blob/develop/scripts/CMakeLists.txt Locates the PkgConfig module to find the fish completions directory. If not found, it sets a default path and logs a message. ```cmake find_package(PkgConfig) if(PkgConfig_FOUND) pkg_get_variable(FISH_COMPLETIONSDIR fish completionsdir) endif() if(NOT FISH_COMPLETIONSDIR) set(FISH_COMPLETIONSDIR share/fish/vendor_completions.d) message(STATUS "fish pkgconfig module missing, assumed completions in ${FISH_COMPLETIONSDIR}") endif() ``` -------------------------------- ### Statistics Request Message Example Source: https://github.com/gothenburgbitfactory/taskwarrior/blob/develop/doc/devel/rfcs/request.md This is the format for a statistics message request. It includes standard headers but has no payload. ```text type: statistics org: user: key: client: taskd 1.0.0 protocol: v1 ``` -------------------------------- ### Run All Taskwarrior Tests Source: https://github.com/gothenburgbitfactory/taskwarrior/blob/develop/test/README.md Execute all available tests using CMake and CTest. Ensure you have built the project first. Tests produce TAP output. ```shell cmake --build build --target test_runner --target task_executable ctest --test-dir build ``` -------------------------------- ### Taskwarrior RC File Syntax for Environment Variables Source: https://github.com/gothenburgbitfactory/taskwarrior/blob/develop/doc/devel/rfcs/rules.md Demonstrates how environment variables can be used inline within the RC file for configuration values and include paths. ```rc name=${TERM} include ${HOME}/.taskrc_local ``` -------------------------------- ### Taskwarrior UUID Format Example Source: https://github.com/gothenburgbitfactory/taskwarrior/blob/develop/doc/devel/rfcs/task.md Demonstrates the required format for a UUID (Universally Unique Identifier) in Taskwarrior, which is a 32-hex-character lowercase string with hyphens. ```text 296d835e-8f85-4224-8f36-c612cad1b9f8 ``` -------------------------------- ### Build Taskwarrior with Clang Source: https://github.com/gothenburgbitfactory/taskwarrior/blob/develop/doc/devel/contrib/development.md Configure the build process to use Clang as the C and C++ compiler. This is useful for developers who prefer Clang or need to test compatibility. ```sh cmake -S . -B build-clang\ -DCMAKE_C_COMPILER=clang\ -DCMAKE_CXX_COMPILER=clang++ cmake --build build-clang ``` -------------------------------- ### Tags Attribute Example Source: https://github.com/gothenburgbitfactory/taskwarrior/blob/develop/doc/devel/rfcs/task.md The 'tags' attribute is an array of strings, where each string is a single word without spaces. Tags are used for categorizing and filtering tasks. ```json "tags":["home","garden"] ``` -------------------------------- ### Use Case 4: Multiple Local and Remote Changes Source: https://github.com/gothenburgbitfactory/taskwarrior/blob/develop/doc/devel/rfcs/sync.md Illustrates a more complex synchronization scenario involving multiple sequential changes on both client and server. ```text Server: T0 --> T1 --> T3 Client: T0 --> T2 --> T4 ``` ```text T0 --> T1 = T0 + d1 T1 --> T3 = T0 + d3 T0 --> T2 = T0 + d2 T2 --> T4 = T0 + d4 ``` ```text d1, d3, d2, d4 ``` ```text T5 = T0 + d1 + d2 + d3 + d4 ``` ```text Server: T0 --> T1 --> T2 --> T3 --> T4 --> T5 Client: T5 ``` -------------------------------- ### Example Annotations in Taskwarrior Source: https://github.com/gothenburgbitfactory/taskwarrior/blob/develop/doc/devel/rfcs/task.md Annotations are stored as an array of objects, each containing a timestamp and a description. This format is used to log historical notes or reminders associated with a task. ```json "annotations":[ {"entry":"20120110T234212Z","description":"Remember to get the mail"}, {"entry":"20120110T234559Z","description":"Pay the bills"} ] ``` -------------------------------- ### Use Case 3: Local and Remote Change Source: https://github.com/gothenburgbitfactory/taskwarrior/blob/develop/doc/devel/rfcs/sync.md Demonstrates the two-branch case where both client and server have made changes to the same base task. ```text Server: T0 --> T1 Client: T0 --> T2 ``` ```text T0 --> T1 = T0 + d1 T0 --> T2 = T0 + d2 ``` ```text T3 = T0 + d1 + d2 ``` ```text Server: T0 --> T1 --> T2 --> T3 Client: T3 ``` -------------------------------- ### Priority Attribute Example Source: https://github.com/gothenburgbitfactory/taskwarrior/blob/develop/doc/devel/rfcs/task.md The 'priority' attribute can be set to 'H' (High), 'M' (Medium), or 'L' (Low). An absent priority field indicates that the task has no assigned priority. ```json "priority":"H" ``` ```json "priority":"M" ``` ```json "priority":"L" ``` -------------------------------- ### Depends Attribute Example Source: https://github.com/gothenburgbitfactory/taskwarrior/blob/develop/doc/devel/rfcs/task.md The 'depends' attribute is a string containing a comma-separated list of UUIDs, indicating task dependencies. A task listed here must be completed before the current task can be considered. ```json "depends":",, ..." ``` -------------------------------- ### Repeat Failing Taskwarrior Tests Source: https://github.com/gothenburgbitfactory/taskwarrior/blob/develop/doc/devel/contrib/development.md Repeat specific tests until they fail, useful for diagnosing intermittent issues. This example runs C++ tests up to 10 times or until a failure occurs. ```sh ctest --test-dir build -R cpp --repeat-until-fail 10 ``` -------------------------------- ### Attribute-Specific Format Examples Source: https://github.com/gothenburgbitfactory/taskwarrior/blob/develop/doc/devel/rfcs/dom.md Taskwarrior supports a variety of attribute-specific formats for different data types, including depends, description, parent, project, status, tags, urgency, and UUID. ```text depends.list depends.count description.combined description.desc description.oneline description.truncated description.count description.truncated_count parent.default|long parent.short project.full project.parent project.indented status.default|long status.short tags.default|list tags.count urgency.default|real urgency.integer uuid.default|long uuid.short ``` -------------------------------- ### Accessing Configuration and System Information Source: https://github.com/gothenburgbitfactory/taskwarrior/blob/develop/doc/devel/rfcs/dom.md DOM references can also access Taskwarrior's configuration settings (rc.) and system/program level information (context.*, system.*). ```text rc. context.program context.args context.width context.height system.version system.os ``` -------------------------------- ### Build Taskwarrior in Parallel Source: https://github.com/gothenburgbitfactory/taskwarrior/blob/develop/doc/devel/contrib/development.md Utilize multiple CPU cores for faster build times by specifying the number of parallel jobs. ```sh cmake --build build -j ``` -------------------------------- ### Project Attribute Example Source: https://github.com/gothenburgbitfactory/taskwarrior/blob/develop/doc/devel/rfcs/task.md The 'project' attribute is a string that can represent a single project or a hierarchical structure using dot notation. This allows for organizing tasks within nested project categories. ```json "project":"Personal Taxes" ``` -------------------------------- ### Initial Sync Request (No Data) Source: https://github.com/gothenburgbitfactory/taskwarrior/blob/develop/doc/devel/rfcs/client.md The first sync request from a client, which may have no data to upload and no previous sync key. ```text type: sync org: user: key: client: task 2.3.0 protocol: v1 ``` -------------------------------- ### Taskwarrior RC File Alternative Syntax Source: https://github.com/gothenburgbitfactory/taskwarrior/blob/develop/doc/devel/rfcs/rules.md Shows the alternative, indentation-sensitive syntax for RC file configuration, which supports nested structures. ```rc a: b: c=... ``` -------------------------------- ### Define Custom Work Week in Taskwarrior Source: https://github.com/gothenburgbitfactory/taskwarrior/blob/develop/doc/devel/rfcs/workweek.md Use the 'workweek' setting to specify which days are considered workdays. Days are numbered 0-6, starting with Sunday. This setting influences 'soww', 'eoww', and 'recur:weekday'. ```bash workweek=1,2,3,4,5 ``` -------------------------------- ### Accessing Task Data with DOM References Source: https://github.com/gothenburgbitfactory/taskwarrior/blob/develop/doc/devel/rfcs/dom.md Use DOM references to access specific attributes of tasks, including nested data. Examples show accessing a task's due date, UUID, entry month, and annotation year. ```text due 123.uuid entry.month 123.annotations.0.entry.year a87bc10f-931b-4558-a44a-e901a77db011.description ``` -------------------------------- ### Chained Task Instance Creation Source: https://github.com/gothenburgbitfactory/taskwarrior/blob/develop/doc/devel/rfcs/recurrence.md Describes how the Nth instance of a chained task is created by cloning from the template and calculating its properties based on the previous instance and template recurrence. ```text instance.uuid: NEW_UUID instance.modified: now instance.due: instance[N-1].end + template.recur instance.wait: instance.due + (template.due - template.wait) instance.scheduled: instance.due + (template.due - template.scheduled) instance.start: ``` -------------------------------- ### Client Identifier Format Source: https://github.com/gothenburgbitfactory/taskwarrior/blob/develop/doc/devel/rfcs/request.md Specifies the format for the 'client' header, which includes the product identifier and version number. ```text taskwarrior 2.3.0 ``` -------------------------------- ### Taskwarrior RC File Syntax for Rules Source: https://github.com/gothenburgbitfactory/taskwarrior/blob/develop/doc/devel/rfcs/rules.md Illustrates the new RC file syntax for defining rules, which is indentation-sensitive and resembles Python. A blank line is required to terminate a rule definition. ```rc rule myRule() on_launch: # Some code here ``` -------------------------------- ### Corrosion Submodule Handling Source: https://github.com/gothenburgbitfactory/taskwarrior/blob/develop/src/taskchampion-cpp/CMakeLists.txt Handles the initialization and update of the Corrosion Git submodule. If submodule initialization fails, it falls back to other methods or disables the feature. ```cmake find_package(Git QUIET) if(GIT_FOUND AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/corrosion/.git) # Try to initialize the submodule message(STATUS "Submodule update: corrosion") execute_process(COMMAND ${GIT_EXECUTABLE} submodule update --init --recursive corrosion WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} RESULT_VARIABLE submodule_res ) if(NOT submodule_res EQUAL 0) message(WARNING "git submodule init failed, setting TASK_USE_CORROSION_SUBMODULE to OFF") set(TASK_USE_CORROSION_SUBMODULE OFF CACHE BOOL \"(Failed to git submodule init)\" FORCE) endif() elseif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/corrosion/CMakeLists.txt) # Maybe the sources were populated in a different way, use them still message(STATUS "Could not initialize submodule corrosion, but the files were already there") else() message(WARNING "cannot initialize git submodule, setting TASK_USE_CORROSION_SUBMODULE to OFF") set(TASK_USE_CORROSION_SUBMODULE OFF CACHE BOOL \"(Cannot git submodule init)\" FORCE) endif() ``` -------------------------------- ### Use Case 2: Local Change Source: https://github.com/gothenburgbitfactory/taskwarrior/blob/develop/doc/devel/rfcs/sync.md Shows how Taskwarrior handles a local modification when the server has the original task. ```text Server: T0 Client: T0 --> T1 ``` ```text T0 --> T1 = T0 + d1 = T1 ``` ```text Server: T0 --> T1 Client: T1 ``` -------------------------------- ### Applying a Delta Source: https://github.com/gothenburgbitfactory/taskwarrior/blob/develop/doc/devel/rfcs/sync.md Demonstrates how a delta (d1) is applied to an original task (T0) to achieve a modified task (T1). ```text T0 --> T1 = T0 + d1 = T0 + (T1 - T0) ``` -------------------------------- ### Configure Shell Tests Source: https://github.com/gothenburgbitfactory/taskwarrior/blob/develop/test/CMakeLists.txt Sets up shell test files and configures CMake to add them as tests. This involves copying test runner scripts and iterating through test files to create test targets. ```cmake set (shell_SRCS tw-1637.test.sh tw-1643.test.sh tw-1688.test.sh tw-1715.test.sh tw-1718.test.sh tw-1804.test.sh tw-1883.test.sh tw-1895.test.sh tw-1938.test.sh tw-2124.test.sh tw-2189.test.sh tw-2257.test.sh tw-2386.test.sh tw-2392.test.sh tw-2429.test.sh tw-2451.test.sh tw-2514.test.sh tw-2530.test.sh tw-2550.test.sh tw-2581.test.sh tw-3102.test.sh tw-3109.test.sh ) configure_file(bash_tap.sh bash_tap.sh COPYONLY) configure_file(bash_tap_tw.sh bash_tap_tw.sh COPYONLY) foreach (shell_Test ${shell_SRCS}) add_test(NAME ${shell_Test} COMMAND bash ${CMAKE_CURRENT_SOURCE_DIR}/${shell_Test} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} ) endforeach(shell_Test) ``` -------------------------------- ### Coverage Build Configuration (Commented Out) Source: https://github.com/gothenburgbitfactory/taskwarrior/blob/develop/src/CMakeLists.txt Commented-out CMake settings for enabling code coverage builds using gcov. ```cmake #SET(CMAKE_BUILD_TYPE gcov) #SET(CMAKE_CXX_FLAGS_GCOV "--coverage") #SET(CMAKE_C_FLAGS_GCOV "--coverage") #SET(CMAKE_EXE_LINKER_FLAGS_GCOV "--coverage") ``` -------------------------------- ### Use Local Taskchampion Version Source: https://github.com/gothenburgbitfactory/taskwarrior/blob/develop/doc/devel/contrib/development.md Configure the build to use a local checkout of Taskchampion by specifying a path dependency in Cargo.toml. This is useful for developing Taskchampion and Taskwarrior in tandem. ```toml taskchampion = { path = "path/to/taskchampion" } ``` -------------------------------- ### Run Taskwarrior Tests in Parallel Source: https://github.com/gothenburgbitfactory/taskwarrior/blob/develop/doc/devel/contrib/development.md Execute the test suite in parallel to reduce the total testing time. Replace '' with the desired number of parallel processes. ```sh ctest --test-dir build -j ``` -------------------------------- ### Manually Run Python Tests Source: https://github.com/gothenburgbitfactory/taskwarrior/blob/develop/test/README.md After building, individual Python tests can be executed directly from the build directory using the python interpreter or as an executable script. ```shell python ./build/testname.test.py ``` ```shell ./build/testname.test.py ``` -------------------------------- ### Configure Performance Test Scripts Source: https://github.com/gothenburgbitfactory/taskwarrior/blob/develop/performance/CMakeLists.txt Copies performance testing scripts and executables into the build directory. Ensure these scripts are present in the source tree. ```cmake cmake_minimum_required (VERSION 3.22...4.0) configure_file(compare_runs.py compare_runs.py COPYONLY) configure_file(load load) configure_file(run_perf run_perf) ``` -------------------------------- ### Add Executable and Link Libraries Source: https://github.com/gothenburgbitfactory/taskwarrior/blob/develop/test/CMakeLists.txt Defines the 'make_tc_task' executable and links it with Taskwarrior libraries. Includes platform-specific library linking for Darwin. ```cmake add_executable (make_tc_task make_tc_task.cpp) target_link_libraries (make_tc_task task commands columns libshared task commands columns libshared task commands columns libshared ${TASK_LIBRARIES}) if (DARWIN) target_link_libraries (make_tc_task "-framework CoreFoundation -framework Security -framework SystemConfiguration") endif (DARWIN) add_dependencies(test_runner make_tc_task) ```