diff --git a/AUTHORS b/AUTHORS index 9617cca..b134bc2 100644 --- a/AUTHORS +++ b/AUTHORS @@ -11,6 +11,7 @@ The following submitted code, packages or analysis, and deserve special thanks: Ben Boeckel ilove zfs Paul Fenwick + Michael Neumann Thanks to the following, who submitted detailed bug reports and excellent suggestions: diff --git a/CMakeLists.txt b/CMakeLists.txt index 205cf7b..083c61a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,7 +6,7 @@ set (HAVE_CMAKE true) project (tasksh) include (CXXSniffer) -set (PROJECT_VERSION "1.2.0") +set (PROJECT_VERSION "1.3.0") include (CheckFunctionExists) include (CheckStructHasMember) @@ -31,11 +31,11 @@ set (PACKAGE_TARNAME "${PACKAGE}") set (PACKAGE_VERSION "${VERSION}") set (PACKAGE_STRING "${PACKAGE} ${VERSION}") -if (FREEBSD) +if (FREEBSD OR DRAGONFLY) SET (TASKSH_MAN1DIR man/man1 CACHE STRING "Installation directory for man pages, section 1") -else (FREEBSD) +else (FREEBSD OR DRAGONFLY) SET (TASKSH_MAN1DIR share/man/man1 CACHE STRING "Installation directory for man pages, section 1") -endif (FREEBSD) +endif (FREEBSD OR DRAGONFLY) SET (TASKSH_DOCDIR share/doc/tasksh CACHE STRING "Installation directory for doc files") SET (TASKSH_RCDIR "${TASKSH_DOCDIR}/rc" CACHE STRING "Installation directory for configuration files") SET (TASKSH_BINDIR bin CACHE STRING "Installation directory for the binary") diff --git a/COPYING b/COPYING index 9295662..ccf46df 100644 --- a/COPYING +++ b/COPYING @@ -1,6 +1,6 @@ tasksh - a shell/frontend for the command line task list manager taskwarrior. -Copyright 2006 - 2017, Paul Beckingham, Federico Hernandez. +Copyright 2006 - 2018, Paul Beckingham, Federico Hernandez. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/ChangeLog b/ChangeLog index 482479c..7ad38f4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +1.3.0 () - + +- TI-91 Timewarrior does not compile on DragonFly + (thanks to Michael Neumann). + +------ current release --------------------------- + 1.2.0 (2017-05-10) 3f4b2284ad19beacd30e202e6c700a36c2b65c60 - TS-29 tasksh hangs trying to read task from stdin @@ -6,11 +13,13 @@ (thanks to Eric Hymowitz, Paul Fenwick). - TS-34 Tasksh throw a warning at the end of a review command (thanks to bjonnh). +- TW-1936 Tweak tests to have fuller TAP compliance + (thanks to Paul J. Fenwick) - Review report now defaults to 6 days instead of 1 weeķ, which is more convenient for those who review weekly (thanks to Dirk Deimeke). ------- current release --------------------------- +------ old releases ------------------------------ 1.1.0 (2016-09-06) 464f5ae19f853911e739c2489897aef64345c388 @@ -30,8 +39,6 @@ review. - Integrated libshared.git. ------- old releases ------------------------------ - 1.0.0 (2014-12-21) 5934dfcefac6d037a359bc733a8382e42e32552e - TS-1 Apostrophe inside tasksh 'log' causes segmentation fault diff --git a/LICENSE b/LICENSE index f9ab300..33c49ba 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ tasksh - a shell/frontend for ithe command line task list manager taskwarrior. -Copyright 2006 - 2017, Paul Beckingham, Federico Hernandez. +Copyright 2006 - 2018, Paul Beckingham, Federico Hernandez. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/NEWS b/NEWS index 4f9546e..a59f357 100644 --- a/NEWS +++ b/NEWS @@ -1,13 +1,13 @@ -New Features in tasksh 1.2.0 - - - Responds to Ctrl-D by exiting. - -New commands in tasksh 1.2.0 +New Features in tasksh 1.3.0 - -New configuration options in tasksh 1.2.0 +New commands in tasksh 1.3.0 + + - + +New configuration options in tasksh 1.3.0 - @@ -32,10 +32,6 @@ encounter a bug, please enter a new issue at: http://bug.tasktools.org -Or you can also report the issue in the forums at: - - http://answers.tasktools.org - Or just send a message to: support@taskwarrior.org diff --git a/cmake.h.in b/cmake.h.in index e905598..b1c400e 100644 --- a/cmake.h.in +++ b/cmake.h.in @@ -32,6 +32,7 @@ #cmakedefine FREEBSD #cmakedefine OPENBSD #cmakedefine NETBSD +#cmakedefine DRAGONFLY #cmakedefine HAIKU #cmakedefine SOLARIS #cmakedefine KFREEBSD diff --git a/cmake/CXXSniffer.cmake b/cmake/CXXSniffer.cmake index 9606226..e7ad810 100644 --- a/cmake/CXXSniffer.cmake +++ b/cmake/CXXSniffer.cmake @@ -17,7 +17,7 @@ elseif (_HAS_GNU0X) message (WARNING "Enabling -std=gnu++0x draft compile flag. Your compiler does not support the standard '-std=c++11' option. Consider upgrading.") set (_CXX11_FLAGS "-std=gnu++0x") else (_HAS_CXX11) - message (FATAL_ERROR "C++11 support missing. Try upgrading your C++ compiler. If you have a good reason for using an outdated compiler, please let us know at support@taskwarrior.org.") + message (FATAL_ERROR "C++11 support missing. Try upgrading your C++ compiler. If you have a good reason for using an outdated compiler, please let us know at support@gothenburgbitfactory.org.") endif (_HAS_CXX11) if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") @@ -33,6 +33,8 @@ elseif (${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD") set (OPENBSD true) elseif (${CMAKE_SYSTEM_NAME} MATCHES "NetBSD") set (NETBSD true) +elseif (${CMAKE_SYSTEM_NAME} MATCHES "DragonFly") + set (DRAGONFLY true) elseif (${CMAKE_SYSTEM_NAME} MATCHES "SunOS") set (SOLARIS true) elseif (${CMAKE_SYSTEM_NAME} STREQUAL "GNU") diff --git a/doc/man/tasksh.1.in b/doc/man/tasksh.1.in index 0b0354c..9aba1fa 100644 --- a/doc/man/tasksh.1.in +++ b/doc/man/tasksh.1.in @@ -1,4 +1,4 @@ -.TH tasksh 1 2017-05-10 "${PACKAGE_STRING}" "User Manuals" +.TH tasksh 1 2018-05-10 "${PACKAGE_STRING}" "User Manuals" .SH NAME tasksh \- Interactive taskwarrior shell @@ -136,7 +136,8 @@ to settings there. If you use a non-standard location for your .task database , and .taskrc file, Tasksh will not find them unless you set the TASKDATA and TASKRC environment variables. See 'man taskrc' for more details. -The review command storeѕ a UDA ('reviewed') and report definition ('_reviewed'). +The review command storeѕ a UDA ('reviewed') and report definition ('_reviewed') +in the Taskwarrior .taskrc file. .TP .B tasksh.autoclear=1 @@ -144,7 +145,7 @@ If set to "1", causes each tasksh command to be preceded by a 'clear screen' and cursor reset. Default is "0". .SH "CREDITS & COPYRIGHTS" -Copyright (C) 2006 \- 2017 P. Beckingham, F. Hernandez. +Copyright (C) 2006 \- 2018 P. Beckingham, F. Hernandez. This man page was originally written by Federico Hernandez. diff --git a/src/diag.cpp b/src/diag.cpp index 8478fba..16ee761 100644 --- a/src/diag.cpp +++ b/src/diag.cpp @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // -// Copyright 2006 - 2017, Paul Beckingham, Federico Hernandez. +// Copyright 2006 - 2018, Paul Beckingham, Federico Hernandez. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/src/help.cpp b/src/help.cpp index 2af1a01..5a1224e 100644 --- a/src/help.cpp +++ b/src/help.cpp @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // -// Copyright 2006 - 2017, Paul Beckingham, Federico Hernandez. +// Copyright 2006 - 2018, Paul Beckingham, Federico Hernandez. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/src/libshared b/src/libshared index f1a3cd6..1fa5dcb 160000 --- a/src/libshared +++ b/src/libshared @@ -1 +1 @@ -Subproject commit f1a3cd6bfabfb083fe3c26f580a15c0d60a92ee9 +Subproject commit 1fa5dcbf53a280857e35436aef6beb6a37266e33 diff --git a/src/main.cpp b/src/main.cpp index afba727..609ad18 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // -// Copyright 2006 - 2017, Paul Beckingham, Federico Hernandez. +// Copyright 2006 - 2018, Paul Beckingham, Federico Hernandez. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/src/prompt.cpp b/src/prompt.cpp index b1d40f5..e16c488 100644 --- a/src/prompt.cpp +++ b/src/prompt.cpp @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // -// Copyright 2006 - 2017, Paul Beckingham, Federico Hernandez. +// Copyright 2006 - 2018, Paul Beckingham, Federico Hernandez. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -28,6 +28,8 @@ #include #include #include +#include +#include static std::vector contextColors = { "bold white on red", @@ -93,11 +95,22 @@ std::string promptCompose () // TODO - The accumulated context, as colored tokens. // TODO - sync status // TODO - time + std::string prompt = "tasksh"; auto decoration = composeContexts (true); if (decoration.length ()) return "task " + decoration + "> "; - return "tasksh> "; + // For now, display the context (if any). + std::string dummy;; + std::string output; + execute ("task", {"_get", "rc.context"}, dummy, output); + output = Lexer::trimRight (output, "\n"); + + if (output != "") + prompt += " (" + output + ")"; + prompt += "> "; + + return prompt; } //////////////////////////////////////////////////////////////////////////////// diff --git a/src/review.cpp b/src/review.cpp index 86ca12f..f984e85 100644 --- a/src/review.cpp +++ b/src/review.cpp @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // -// Copyright 2006 - 2017, Paul Beckingham, Federico Hernandez. +// Copyright 2006 - 2018, Paul Beckingham, Federico Hernandez. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -181,7 +181,7 @@ static const std::string banner ( //////////////////////////////////////////////////////////////////////////////// static const std::string menu () { - return Color ("color15 on gray6").colorize (" (Enter) Mark as reviewed, (s)kip, (e)dit, (m)odify, (c)omplete, (d)elete, (q)uit ") + " "; + return Color ("color15 on gray6").colorize (" (Enter) Mark as reviewed, (s)kip, (e)dit, (i)nformation, (m)odify, (c)omplete, (d)elete, (q)uit ") + " "; } //////////////////////////////////////////////////////////////////////////////// @@ -226,10 +226,6 @@ static void reviewLoop (const std::vector & uuids, unsigned int lim repeat = false; std::cout << banner (current + 1, total, width, Lexer::trimRight (description, "\n")); - // Use 'system' to run the command and show the output. - std::string command = "task " + uuid + " information"; - system (command.c_str ()); - // Display prompt, get input. response = getResponse (menu ()); @@ -241,6 +237,11 @@ static void reviewLoop (const std::vector & uuids, unsigned int lim else if (response == "") { reviewTask (uuid); ++current; ++reviewed; } else if (response == "r") { reviewTask (uuid); ++current; ++reviewed; } else if (response == "q") { break; } + else if (response == "i") { + // Use 'system' to run the command and show the output. + std::string command = "task " + uuid + " information"; + system (command.c_str ()); + } else { diff --git a/src/shell.cpp b/src/shell.cpp index 8c14590..0ba0fa5 100644 --- a/src/shell.cpp +++ b/src/shell.cpp @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // -// Copyright 2006 - 2017, Paul Beckingham, Federico Hernandez. +// Copyright 2006 - 2018, Paul Beckingham, Federico Hernandez. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/test/problems b/test/problems index 5bacda4..3e73942 100755 --- a/test/problems +++ b/test/problems @@ -54,6 +54,15 @@ if __name__ == "__main__": file = re.compile("^# (?:./)?(\S+\.t)(?:\.exe)?$") timestamp = re.compile("^# (\d+(?:\.\d+)?) ==>.*$") + + expected_fail = re.compile(r"^not ok.*?#\s*TODO", re.I) + unexpected_pass = re.compile(r"^ok .*?#\s*TODO", re.I) + skip = re.compile(r"^ok .*?#\s*skip", re.I) + ok = re.compile(r"^ok ", re.I) + not_ok = re.compile(r"^not ok", re.I) + comment = re.compile(r"^#") + plan = re.compile(r"^1..\d+\s*(?:#.*)?$") + start = None stop = None @@ -68,31 +77,37 @@ if __name__ == "__main__": if match: filename = match.group(1) - if line.startswith("ok "): - passed[filename] += 1 - - if line.startswith("not "): - errors[filename] += 1 - - if line.startswith("skip "): - skipped[filename] += 1 - - if line.startswith("# EXPECTED_FAILURE:"): + elif expected_fail.match(line): expected[filename] += 1 - if line.startswith("# UNEXPECTED_SUCCESS:"): + elif unexpected_pass.match(line): unexpected[filename] += 1 + elif skip.match(line): + skipped[filename] += 1 + + # It's important these come last, since they're subpatterns of the above + + elif ok.match(line): + passed[filename] += 1 + + elif not_ok.match(line): + errors[filename] += 1 + + elif comment.match(line): + pass + + elif plan.match(line): + pass + + else: + # Uncomment if you want to see malformed things we caught as well... + # print(color("Malformed TAP (" + filename + "): " + line, "red")) + pass + # Last line contains the ending timestamp stop = float(timestamp.match(line).group(1)) - # Remove expected failures from the skipped tests category - for filename, value in expected.items(): - if skipped[filename] == value: - del skipped[filename] - else: - skipped[filename] -= value - v = "{0:>5d}" passed_str = "Passed:" + pad(24) passed_int = v.format(sum(passed.values())) diff --git a/test/simpletap/__init__.py b/test/simpletap/__init__.py index 518d48c..110ae84 100644 --- a/test/simpletap/__init__.py +++ b/test/simpletap/__init__.py @@ -1,6 +1,7 @@ ############################################################################### +# taskwarrior - a command line task list manager. # -# Copyright 2006 - 2017, Paul Beckingham, Federico Hernandez. +# Copyright 2006 - 2018, Paul Beckingham, Federico Hernandez. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -154,12 +155,12 @@ class TAPTestResult(unittest.result.TestResult): if status: if status == "SKIP": - self.stream.writeln("{0} {1} - {2}: {3}".format( - color("skip", "yellow"), self.testsRun, filename, desc) + self.stream.writeln("{0} {1} - {2}: {3} # skip".format( + color("ok", "yellow"), self.testsRun, filename, desc) ) elif status == "EXPECTED_FAILURE": - self.stream.writeln("{0} {1} - {2}: {3}".format( - color("skip", "yellow"), self.testsRun, filename, desc) + self.stream.writeln("{0} {1} - {2}: {3} # TODO".format( + color("not ok", "yellow"), self.testsRun, filename, desc) ) else: self.stream.writeln("{0} {1} - {2}: {3}".format( @@ -226,6 +227,10 @@ class TAPTestRunner(unittest.runner.TextTestRunner): unittest.signals.registerResult(result) result.failfast = self.failfast + # TAP requires output is on STDOUT. + # TODO: Define this at __init__ time + result.stream = unittest.runner._WritelnDecorator(sys.stdout) + with warnings.catch_warnings(): if getattr(self, "warnings", None): # if self.warnings is set, use it to filter all the warnings diff --git a/test/template.t b/test/template.t index 027b1d0..4533ba9 100644 --- a/test/template.t +++ b/test/template.t @@ -2,7 +2,7 @@ # -*- coding: utf-8 -*- ############################################################################### # -# Copyright 2006 - 2017, Paul Beckingham, Federico Hernandez. +# Copyright 2006 - 2018, Paul Beckingham, Federico Hernandez. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/test/test.cpp b/test/test.cpp index 9dc7552..2992147 100644 --- a/test/test.cpp +++ b/test/test.cpp @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // -// Copyright 2006 - 2017, Paul Beckingham, Federico Hernandez. +// Copyright 2006 - 2018, Paul Beckingham, Federico Hernandez. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -51,7 +51,7 @@ UnitTest::UnitTest (int planned) , _failed (0) , _skipped (0) { - std::cout << "1.." << _planned << "\n"; + std::cout << "1.." << _planned << '\n'; } /////////////////////////////////////////////////////////////////////////////// @@ -99,14 +99,14 @@ void UnitTest::plan (int planned) _failed = 0; _skipped = 0; - std::cout << "1.." << _planned << "\n"; + std::cout << "1.." << _planned << '\n'; } /////////////////////////////////////////////////////////////////////////////// void UnitTest::planMore (int extra) { _planned += extra; - std::cout << "1.." << _planned << "\n"; + std::cout << "1.." << _planned << '\n'; } /////////////////////////////////////////////////////////////////////////////// @@ -122,7 +122,7 @@ void UnitTest::ok (bool expression, const std::string& name) << _counter << " - " << name - << "\n"; + << '\n'; } else { @@ -132,7 +132,7 @@ void UnitTest::ok (bool expression, const std::string& name) << _counter << " - " << name - << "\n"; + << '\n'; } } @@ -149,7 +149,7 @@ void UnitTest::notok (bool expression, const std::string& name) << _counter << " - " << name - << "\n"; + << '\n'; } else { @@ -159,7 +159,7 @@ void UnitTest::notok (bool expression, const std::string& name) << _counter << " - " << name - << "\n"; + << '\n'; } } @@ -175,7 +175,7 @@ void UnitTest::is (bool actual, bool expected, const std::string& name) << _counter << " - " << name - << "\n"; + << '\n'; } else { @@ -189,7 +189,7 @@ void UnitTest::is (bool actual, bool expected, const std::string& name) << expected << "\n# got: " << actual - << "\n"; + << '\n'; } } @@ -205,7 +205,7 @@ void UnitTest::is (size_t actual, size_t expected, const std::string& name) << _counter << " - " << name - << "\n"; + << '\n'; } else { @@ -219,7 +219,7 @@ void UnitTest::is (size_t actual, size_t expected, const std::string& name) << expected << "\n# got: " << actual - << "\n"; + << '\n'; } } @@ -235,7 +235,7 @@ void UnitTest::is (int actual, int expected, const std::string& name) << _counter << " - " << name - << "\n"; + << '\n'; } else { @@ -249,7 +249,7 @@ void UnitTest::is (int actual, int expected, const std::string& name) << expected << "\n# got: " << actual - << "\n"; + << '\n'; } } @@ -265,7 +265,7 @@ void UnitTest::is (double actual, double expected, const std::string& name) << _counter << " - " << name - << "\n"; + << '\n'; } else { @@ -279,7 +279,7 @@ void UnitTest::is (double actual, double expected, const std::string& name) << expected << "\n# got: " << actual - << "\n"; + << '\n'; } } @@ -295,7 +295,7 @@ void UnitTest::is (double actual, double expected, double tolerance, const std:: << _counter << " - " << name - << "\n"; + << '\n'; } else { @@ -309,7 +309,7 @@ void UnitTest::is (double actual, double expected, double tolerance, const std:: << expected << "\n# got: " << actual - << "\n"; + << '\n'; } } @@ -325,7 +325,7 @@ void UnitTest::is (unsigned char actual, unsigned char expected, const std::stri << _counter << " - " << name - << "\n"; + << '\n'; } else { @@ -339,7 +339,7 @@ void UnitTest::is (unsigned char actual, unsigned char expected, const std::stri << expected << "\n# got: " << actual - << "\n"; + << '\n'; } } @@ -358,7 +358,7 @@ void UnitTest::is ( << _counter << " - " << name - << "\n"; + << '\n'; } else { @@ -392,7 +392,7 @@ void UnitTest::is ( << _counter << " - " << name - << "\n"; + << '\n'; } else { @@ -418,7 +418,7 @@ void UnitTest::diag (const std::string& text) auto end = text.find_last_not_of (" \t\n\r\f"); if (start != std::string::npos && end != std::string::npos) - std::cout << "# " << text.substr (start, end - start + 1) << "\n"; + std::cout << "# " << text.substr (start, end - start + 1) << '\n'; } /////////////////////////////////////////////////////////////////////////////// @@ -431,7 +431,7 @@ void UnitTest::pass (const std::string& text) << _counter << " - " << text - << "\n"; + << '\n'; } /////////////////////////////////////////////////////////////////////////////// @@ -444,7 +444,7 @@ void UnitTest::fail (const std::string& text) << _counter << " - " << text - << "\n"; + << '\n'; } /////////////////////////////////////////////////////////////////////////////// @@ -452,12 +452,13 @@ void UnitTest::skip (const std::string& text) { ++_counter; ++_skipped; - std::cout << yellow ("skip") + std::cout << yellow ("ok") << " " << _counter << " - " << text - << "\n"; + << " # skip" + << '\n'; } /////////////////////////////////////////////////////////////////////////////// diff --git a/test/test.h b/test/test.h index fa65f9b..557d9f0 100644 --- a/test/test.h +++ b/test/test.h @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // -// Copyright 2006 - 2017, Paul Beckingham, Federico Hernandez. +// Copyright 2006 - 2018, Paul Beckingham, Federico Hernandez. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/test/version.t b/test/version.t index d2d5354..94381d3 100755 --- a/test/version.t +++ b/test/version.t @@ -2,7 +2,7 @@ # -*- coding: utf-8 -*- ############################################################################### # -# Copyright 2006 - 2017, Paul Beckingham, Federico Hernandez. +# Copyright 2006 - 2018, Paul Beckingham, Federico Hernandez. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal