Some new patches and cleaned-up old ones: test cleanups, tools and an
actual feature that I wanted. To save work I'm just letting it send
everything, this supersedes all pending patches from me.
Tue Aug 5 15:21:08 PDT 2008 Simon Michael <[EMAIL PROTECTED]>
* run only normal (expected to pass) tests by default
Tue Aug 5 15:22:41 PDT 2008 Simon Michael <[EMAIL PROTECTED]>
* make searching for "test:" in makefile work
Wed Aug 6 10:04:32 PDT 2008 Simon Michael <[EMAIL PROTECTED]>
* fix an old spelling error
Wed Aug 6 12:13:36 PDT 2008 Simon Michael <[EMAIL PROTECTED]>
* move (most) failing tests to bugs for clean test output
Wed Aug 6 20:04:16 PDT 2008 Simon Michael <[EMAIL PROTECTED]>
* document how to run unit tests
Wed Aug 6 20:25:42 PDT 2008 Simon Michael <[EMAIL PROTECTED]>
* rename GNUmakefile to Makefile.
Wed Aug 6 21:03:23 PDT 2008 Simon Michael <[EMAIL PROTECTED]>
* make test-running targets & docs a little clearer
Wed Aug 6 23:07:10 PDT 2008 Simon Michael <[EMAIL PROTECTED]>
* make list_authors stats show ranking, to stimulate those patching juices
Thu Aug 7 00:07:15 PDT 2008 Simon Michael <[EMAIL PROTECTED]>
* add a make index target which generates an INDEX to aid code comprehension
Thu Aug 7 00:47:00 PDT 2008 Simon Michael <[EMAIL PROTECTED]>
* minor index.hs cleanups
Thu Aug 7 00:51:14 PDT 2008 Simon Michael <[EMAIL PROTECTED]>
* "make overview" shows module structure
Thu Aug 7 00:57:19 PDT 2008 Simon Michael <[EMAIL PROTECTED]>
* easy "make authors" and "make authorstats" targets
Thu Aug 7 01:24:08 PDT 2008 Simon Michael <[EMAIL PROTECTED]>
* make this test more platform-compatible
Thu Aug 7 01:43:43 PDT 2008 Simon Michael <[EMAIL PROTECTED]>
* "make bench" runs performance tests
Thu Aug 7 03:07:01 PDT 2008 Simon Michael <[EMAIL PROTECTED]>
* make -q have an effect with darcs changes (show just patch names)
New patches:
[run only normal (expected to pass) tests by default
Simon Michael <[EMAIL PROTECTED]>**20080805222108] hunk ./GNUmakefile 339
-test check: tests bugs
+test check: tests
[make searching for "test:" in makefile work
Simon Michael <[EMAIL PROTECTED]>**20080805222241] hunk ./GNUmakefile 339
-test check: tests
+check test: tests
[fix an old spelling error
Simon Michael <[EMAIL PROTECTED]>**20080806170432] hunk ./tests/README.test_maintainers.txt 120
- their is an error.
+ there is an error.
[move (most) failing tests to bugs for clean test output
Simon Michael <[EMAIL PROTECTED]>**20080806191336] addfile ./bugs/add.pl
addfile ./bugs/dist.pl
addfile ./bugs/merging_newlines.pl
hunk ./bugs/add.pl 1
+#!/usr/bin/env perl
+
+# Some tests for 'darcs add'
+
+use lib 'lib/perl';
+use Test::More 'no_plan';
+use Test::Darcs;
+use Shell::Command;
+use strict;
+use warnings;
+
+init_tmp_repo();
+
+###
+
+TODO: {
+ local $TODO = 'waiting on coding';
+ my $test_name = "add should fail on files it can't read (because it would fail to record it later anyway).";
+ touch "no_perms.txt";
+ chmod(0000,"no_perms.txt");
+ like(darcs(qw(add no_perms.txt)), qr/permission denied/,$test_name);
+ rm_rf "no_perms.txt";
+
+}
+
+chdir '../';
hunk ./bugs/dist.pl 1
+#!/usr/bin/env perl
+
+# tests for "darcs dist"
+
+use lib 'lib/perl';
+use Test::More 'no_plan';
+use strict;
+use Test::Darcs;
+use Shell::Command;
+
+init_tmp_repo();
+
+TODO: {
+ local $TODO = "needs fixed on FreeBSD" if ($^O eq 'freebsd');
+ unlike( darcs("dist -v"), qr/error/i, "darcs dist -v avoids error message " );
+}
hunk ./bugs/merging_newlines.pl 1
+#!/usr/bin/env perl
+
+# A test for darcs resolve detecting a conflict, inspired by bug #152 in RT
+
+use lib 'lib/perl';
+use Test::More 'no_plan';
+use Test::Darcs;
+use Shell::Command;
+use strict;
+use warnings;
+use File::Slurp;
+use File::Temp 'tempdir';
+my $work_dir = tempdir( CLEANUP => 1 );
+chdir $work_dir;
+
+
+TODO: {
+ local $TODO = 'waiting on code to fix this';
+ unlike(darcs(q(resolve)),qr/no conflicts/i, "after a conflict, darcs resolve should report a conflict");
+}
+
hunk ./tests/add.pl 62
-TODO: {
- local $TODO = 'waiting on coding';
- my $test_name = "add should fail on files it can't read (because it would fail to record it later anyway).";
- touch "no_perms.txt";
- chmod(0000,"no_perms.txt");
- like(darcs(qw(add no_perms.txt)), qr/permission denied/,$test_name);
- rm_rf "no_perms.txt";
-
-}
-
-
hunk ./tests/dist.pl 17
-TODO: {
- local $TODO = "needs fixed on FreeBSD" if ($^O eq 'freebsd');
- unlike( darcs("dist -v"), qr/error/i, "darcs dist -v avoids error message " );
-}
hunk ./tests/merging_newlines.pl 46
-TODO: {
- local $TODO = 'waiting on code to fix this';
- unlike(darcs(q(resolve)),qr/no conflicts/i, "after a conflict, darcs resolve should report a conflict");
-}
-
[document how to run unit tests
Simon Michael <[EMAIL PROTECTED]>**20080807030416] hunk ./tests/README.test_maintainers.txt 11
-in tests/. Additionally, there are functional tests which are currently
-expected to fail. These are useful for documenting bugs and todo items,
-and are kept in bugs/.
+in tests/. Additionally, there are some functional tests which are
+expected to fail, kept in bugs/ and used for documenting bugs and todos.
hunk ./tests/README.test_maintainers.txt 17
-These can be run via "make unit", and are not yet documented here.
+These are QuickCheck tests primarily testing the Darcs core.
hunk ./tests/README.test_maintainers.txt 40
-Running tests starts with the test... targets in GNUmakefile:
-
-"make unit" runs the unit tests, as noted.
+"make unit" builds the unit tests, "./unit" runs them. They take a while.
+Output like "good" and "OK, passed 100 tests." is good. Output like
+"*** Gave up! Passed only n tests." is a shortage of quickcheck test
+cases, not a test failure.
[rename GNUmakefile to Makefile.
Simon Michael <[EMAIL PROTECTED]>**20080807032542] move ./GNUmakefile ./Makefile
hunk ./tests/network/changes.sh 8
-"$DARCS" changes --repo=http://darcs.net GNUmakefile --last 300
+"$DARCS" changes --repo=http://darcs.net Makefile --last 300
[make test-running targets & docs a little clearer
Simon Michael <[EMAIL PROTECTED]>**20080807040323] hunk ./Makefile 339
-check test: tests
+check test: functests
hunk ./Makefile 341
-tests: \
+unittests: unit
+ ./unit
+
+functests: \
hunk ./tests/README.test_maintainers.txt 40
-"make unit" builds the unit tests, "./unit" runs them. They take a while.
+"make unittests" builds the unit tests and runs them. They take a while.
hunk ./tests/README.test_maintainers.txt 45
-"make test" causes all the functional tests in "tests/" to be run against
-repositories in the old, hashed, and darcs2 formats.
+"make functests" causes all the functional tests in "tests/" to be run
+against repositories in the old, hashed, and darcs2 formats.
hunk ./tests/README.test_maintainers.txt 51
-Because "make test" can take a long time to run, it's useful to run fewer
-tests at once. To help with that, the following make targets are also
-available:
+Because these can take a long time, it's useful to run fewer tests at
+once. To help with that, the following make targets are also available:
hunk ./tests/README.test_maintainers.txt 67
+"make test" currently runs the functional tests. This target is run
+automatically when adding a patch to the darcs repo.
+
[make list_authors stats show ranking, to stimulate those patching juices
Simon Michael <[EMAIL PROTECTED]>**20080807060710] hunk ./src/list_authors.hs 30
+import Text.Printf ( printf )
hunk ./src/list_authors.hs 189
-sort_authors use_stats as = reverse $ map shownames $ sort $
+sort_authors use_stats as = add_numbers $ reverse $ map shownames $ sort $
hunk ./src/list_authors.hs 192
- where shownames (n, a) = if use_stats
- then show n ++ "\t" ++ a
- else a
-
+ where
+ shownames (n, a) = if use_stats
+ then printf "%4d %s" n a
+ else a
+ add_numbers strs = if use_stats
+ then [printf "%3d. %s" n s | (n, s) <- zip nums strs]
+ else strs
+ nums = iterate (+1) (1::Integer)
+
[add a make index target which generates an INDEX to aid code comprehension
Simon Michael <[EMAIL PROTECTED]>**20080807070715] addfile ./tools/index.hs
hunk ./Makefile 328
+index INDEX: src/darcs.lhs $(DARCS_FILES) tools/index.hs
+ tools/index.hs $(DARCS_FILES) >INDEX
+
hunk ./tools/index.hs 1
+#!/usr/bin/env runhaskell
+{-
+Print an index of functions in haskell files, to aid code comprehension.
+
+Usage: "make index" in the main darcs directory (or index.hs file1.hs [...])
+
+Tips: for best color-coded viewing, load the INDEX into Emacs. If org mode
+is available, Tab on a heading will hide/show the contents. Do make tags,
+visit-tags-table TAGS, then M-. on a name to jump there.
+
+Simon Michael 2008
+-}
+
+import System
+import System.Process
+import IO
+import Data.List
+import Data.Map hiding (map,split)
+import Text.Printf (printf)
+import Control.Monad (when)
+
+split :: (Eq a) => a -> [a] -> ([a], [a])
+split x xs = (as, drop 1 bs) where (as,bs) = break (== x) xs
+
+main = do
+ files <- getArgs
+ let cmd = "grep -H '^\\w[^=]*::' " ++ (concat $ intersperse " " $ files)
+ (_, out, err, _) <- runInteractiveCommand cmd
+ grepoutput <- hGetContents out
+ let m = fromListWith (flip (++)) [(a,[b]) | (a,b) <- map (split ':') $ lines grepoutput]
+ sequence $ map printgroup $ assocs m
+ when (length files > 0) printemacsfooter
+
+printgroup (k,vs) = do
+ putStr $ "* " ++ k ++ "\n"
+ sequence $ map printline vs
+ putStr "\n"
+
+printline l = do
+ putStrLn l -- $ printf "%-22s %-40s %s" (file++":") code typedecl
+ where
+ (file, rest) = break (== ':') l
+ (code, typedecl) = break (== ':') $ tail rest
+
+printemacsfooter = do
+ putStrLn "\
+\* \n\
+\Local Variables:\n\
+\mode: haskell\n\
+\eval: (condition-case nil (highlight-lines-matching-regexp \"^\\* \" (quote hi-pink)) (error nil))\n\
+\eval: (condition-case nil (orgstruct-mode) (error nil))\n\
+\End:\n\
+\" -- "
[minor index.hs cleanups
Simon Michael <[EMAIL PROTECTED]>**20080807074700] hunk ./Makefile 328
-index INDEX: src/darcs.lhs $(DARCS_FILES) tools/index.hs
+index INDEX: $(DARCS_FILES) tools/index.hs
hunk ./tools/index.hs 7
-Tips: for best color-coded viewing, load the INDEX into Emacs. If org mode
-is available, Tab on a heading will hide/show the contents. Do make tags,
-visit-tags-table TAGS, then M-. on a name to jump there.
+Tips:
+
+- for best color-coded viewing, load the INDEX into emacs
+- if org mode is available, use tab on headings to collapse/expand the contents
+- collapse all (or grep '*') to get an overview of darcs code
+- do make tags, visit-tags-table TAGS, then M-. on names to jump there
+ (or make ctags, vi stuff)
hunk ./tools/index.hs 26
-split :: (Eq a) => a -> [a] -> ([a], [a])
-split x xs = (as, drop 1 bs) where (as,bs) = break (== x) xs
-
hunk ./tools/index.hs 35
+split :: (Eq a) => a -> [a] -> ([a], [a])
+split x xs = (as, drop 1 bs) where (as,bs) = break (== x) xs
+
["make overview" shows module structure
Simon Michael <[EMAIL PROTECTED]>**20080807075114] hunk ./Makefile 331
+overview: INDEX
+ egrep '^\*' INDEX
+
hunk ./tools/index.hs 51
-\* \n\
+\\n\n\
[easy "make authors" and "make authorstats" targets
Simon Michael <[EMAIL PROTECTED]>**20080807075719] hunk ./Makefile 328
+authors: list_authors
+ ./list_authors
+
+authorstats: list_authors
+ ./list_authors stats
+
[make this test more platform-compatible
Simon Michael <[EMAIL PROTECTED]>**20080807082408] hunk ./bench/many_conflicting_changes.sh 14
-cp -a temp1 temp2
+cp -RPp temp1 temp2
["make bench" runs performance tests
Simon Michael <[EMAIL PROTECTED]>**20080807084343] hunk ./Makefile 364
+.PHONY: bench
+bench: darcs microbench
+ for f in bench/*.sh; do time perl tests/shell_harness $$f; done
+ for t in sha1 sha2; do time ./microbench $$t darcs >/dev/null; done
+
hunk ./tests/README.test_maintainers.txt 11
-in tests/. Additionally, there are some functional tests which are
-expected to fail, kept in bugs/ and used for documenting bugs and todos.
+in tests/. Additionally, there are tests which are expected to fail, used
+for documenting bugs and todos, in bugs/; and tests used for measuring
+performance in bench/.
+
hunk ./tests/README.test_maintainers.txt 69
-"make test" currently runs the functional tests. This target is run
-automatically when adding a patch to the darcs repo.
+"make bench" runs the scripts in bench/ and times each one.
+
+"make test" is the target that is run automatically when adding a patch to
+the darcs repo. It currently runs the functional tests.
[make -q have an effect with darcs changes (show just patch names)
Simon Michael <[EMAIL PROTECTED]>**20080807100701] hunk ./src/Darcs/Commands/Changes.lhs 33
- XMLOutput, Summary, Reverse, Verbose, Debug),
+ XMLOutput, Summary, Reverse, Debug,
+ Verbose, Quiet),
hunk ./src/Darcs/Commands/Changes.lhs 205
+ | Quiet `elem` opts = vcat (map (number_patch just_the_name) pis)
+ $$ errstring
hunk ./src/Darcs/Commands/Changes.lhs 242
+ just_the_name = text . firstline . renderString . description
+ firstline s = lines s !! 1
Context:
[make order of running tests consistent
Simon Michael <[EMAIL PROTECTED]>**20080806172123]
[cleanup and slight rewrite of the test docs
Simon Michael <[EMAIL PROTECTED]>**20080806165949]
[small makefile refactoring: allow just the normal tests to be run, without bugs/*
Simon Michael <[EMAIL PROTECTED]>**20080805203242]
[Rectify dist help
[EMAIL PROTECTED]
Removed the "make dist" suggestion, the manual is a better place for that.
Instead, make clear that it operates on a clean copy of the tree, and
mention the "predist" functionality.
]
[Canonize Gaetan Lehmann and Daniel Buenzli.
Eric Kow <[EMAIL PROTECTED]>**20080730104357
(for Daniel B, avoid an accent in his name)
]
[configure: check for packages needed with split base.
Eric Kow <[EMAIL PROTECTED]>**20080730103840
Now that all packages must be used explicitly.
]
[fix type witness compile errors specific to ghc 6.8
Jason Dagit <[EMAIL PROTECTED]>**20080722182729]
[website: explain that darcs 2 is required to get the darcs source.
Simon Michael <[EMAIL PROTECTED]>**20080803181216]
[avoid import of unused function fromMaybe.
David Roundy <[EMAIL PROTECTED]>**20080729172825]
[configure: suggest regex-compat before text
Eric Kow <[EMAIL PROTECTED]>**20080725095336]
[configure: mention Haskell in 'try installing' suggestion
Eric Kow <[EMAIL PROTECTED]>**20080725095015]
[Typo (Text.Regex)
Eric Kow <[EMAIL PROTECTED]>**20080715121708]
[Use haskeline to have a readline-like behavior when asking something to the user
[EMAIL PROTECTED]
Unlike the implementations using readline or editline packages, this code
code doesn't break the Ctrl-C behavior.
]
[Improve generic rules for English plurals.
Eric Kow <[EMAIL PROTECTED]>**20080604123728]
[add configure check for Network.URI.
David Roundy <[EMAIL PROTECTED]>**20080711011914]
[add -hide-all-packages to default GHCFLAGS.
David Roundy <[EMAIL PROTECTED]>**20080711010952]
[add support for outputting patch numbers in darcs changes.
David Roundy <[EMAIL PROTECTED]>**20080710011211]
[add support for matching single patches by index.
David Roundy <[EMAIL PROTECTED]>**20080710004512]
[add support for matching ranges of patches (counting back from present).
David Roundy <[EMAIL PROTECTED]>**20080710003225]
[Better avoid silly manpage error.
Trent W. Buck <[EMAIL PROTECTED]>**20080704024920
It turned out only initialize's help string used 'quotes', so just
remove them. This makes init's docstring consistent with the others.
]
[Missing period at end of sentence.
Trent W. Buck <[EMAIL PROTECTED]>**20080704024232]
[darcs --overview no longer works, so don't document it.
Trent W. Buck <[EMAIL PROTECTED]>**20080704030804]
[Avoid silly manpage error.
Trent W. Buck <[EMAIL PROTECTED]>**20080703010733
man (nroff) treats an apostrophe in the first column specially,
resulting in a syntax error without this patch.
Ideally, all cases of 'foo' in the manpage (i.e. docstrings) should
become `foo', since man -Tps turns ` and ' into left and right single
quotes respectively.
]
[obliterate whitespace in Darcs.Commands.Get
[EMAIL PROTECTED]
'twas causing lhs/haddock difficulties where a \end{code} wasn't getting recognized.
]
[rm haddock CPP business
[EMAIL PROTECTED]
Try as I might, I can't see any reason to special-case some Haddock CPP logic to deal with some *commented-out guards*, unless CPP magically restores and uncomments the code if Haddock isn't being run.
]
[make pull less verbose when --verbose flag is given.
David Roundy <[EMAIL PROTECTED]>**20080624170035]
[fix makefile to remember to regenerate version information after running configure.
David Roundy <[EMAIL PROTECTED]>**20080624170001]
[TAG 2.0.2
David Roundy <[EMAIL PROTECTED]>**20080624012041]
Patch bundle hash:
60c520004f9eeb539fb5b603163e5dbc29aace93
_______________________________________________
darcs-users mailing list
[email protected]
http://lists.osuosl.org/mailman/listinfo/darcs-users