From jim at weirichhouse.org Sun May 1 00:30:06 2005 From: jim at weirichhouse.org (Jim Weirich) Date: Sun May 1 00:24:02 2005 Subject: [Rake-devel] still the same bug in unittest of rake 0.5.4 In-Reply-To: <4274233E.6020105@skynet.be> References: <4274233E.6020105@skynet.be> Message-ID: <50145.216.23.53.177.1114921806.squirrel@onestepback.org> Lionel Thiry said: > Hello! > > The exact same bug is still here in rake-0.5.4. > > I worked some on it and I found where it lies. [... File creation bug and subsequent permission errors discussion elided ...] Ya, I went downt the same road and got stuck in much the same place. I only have access to a windows box at work and don't get much Rake debug time there. If you get any great insights, please pass them on. Meanwhile, I should problably put something in the release notes. Thanks for checking this. -- -- Jim Weirich jim@weirichhouse.org http://onestepback.org ----------------------------------------------------------------- "Beware of bugs in the above code; I have only proved it correct, not tried it." -- Donald Knuth (in a memo to Peter van Emde Boas) From djberge at qwest.com Mon May 2 12:22:45 2005 From: djberge at qwest.com (Daniel Berger) Date: Mon May 2 12:41:55 2005 Subject: [Rake-devel] Fix for infinite loop bug Message-ID: <427653D5.3020409@qwest.com> Hi all, The following change fixes the infinite loop on Win32 systems. The logic is simple - if the dir length is the same in two iterations, it means we've reached the "root" directory and it's not going to get any smaller. --- rake.orig Mon May 2 09:25:51 2005 +++ rake.rb Mon May 2 09:36:16 2005 @@ -406,10 +406,12 @@ # directory "testdata/doc" # def directory(dir) - while dir != '.' && dir != '/' + old_length = nil + while dir != '.' && dir.length != old_length file dir do |t| mkdir_p t.name if ! File.exist?(t.name) end + old_length = dir.length dir = File.dirname(dir) end end I ran testtasks.rb on Solaris after this to make sure it worked: >ruby test/testtasks.rb Loaded suite test/testtasks Started ......................F...... Finished in 3.564708 seconds. 1) Failure: test_create(TestTask) [test/testtasks.rb:19]: is not true. 29 tests, 66 assertions, 1 failures, 0 errors The failure you see occurs with or without this change, so it's unrelated. The test in question is: assert t.prerequisites.is_a?(FileList) I haven't provided any test cases yet because it appears there are still other places where rake.rb goes into an infinite loop (running testtasks.rb confirms this). I think it's coming from create_timed_files atm. I'll patch 'em as I see 'em. Regards, Dan From jim at weirichhouse.org Mon May 2 13:34:01 2005 From: jim at weirichhouse.org (Jim Weirich) Date: Mon May 2 13:27:52 2005 Subject: [Rake-devel] Fix for infinite loop bug In-Reply-To: <427653D5.3020409@qwest.com> References: <427653D5.3020409@qwest.com> Message-ID: <46764.192.223.163.5.1115055241.squirrel@weirichhouse.org> Daniel Berger said: > Hi all, > > The following change fixes the infinite loop on Win32 systems. The > logic is simple - if the dir length is the same in two iterations, it > means we've reached the "root" directory and it's not going to get any > smaller. Excellent! It is even simplier that the original. I love it. [... patch elided ...] > I ran testtasks.rb on Solaris after this to make sure it worked: > > >ruby test/testtasks.rb > Loaded suite test/testtasks > Started > ......................F...... > Finished in 3.564708 seconds. > > 1) Failure: > test_create(TestTask) [test/testtasks.rb:19]: > is not true. > > 29 tests, 66 assertions, 1 failures, 0 errors > > The failure you see occurs with or without this change, so it's > unrelated. The test in question is: > > assert t.prerequisites.is_a?(FileList) Thanks ... I'll check this. > I haven't provided any test cases yet because it appears there are still > other places where rake.rb goes into an infinite loop (running > testtasks.rb confirms this). I think it's coming from > create_timed_files atm. Yes. The issue is this. I need to create to files with known relative time differences to test the file based prerequisite triggering. So I create one file and then then second. If the second has the same time as the first, I delete it, sleep a bit and recreate it. Eventually the time of the second file will be different.... except in windows the time of the the file never changes, causing an infinite loop. > I'll patch 'em as I see 'em. I'd love to get clean unit tests on windows. Any patches will be gleefully accepted. -- -- Jim Weirich jim@weirichhouse.org http://onestepback.org ----------------------------------------------------------------- "Beware of bugs in the above code; I have only proved it correct, not tried it." -- Donald Knuth (in a memo to Peter van Emde Boas) From lthiry at skynet.be Mon May 2 13:39:20 2005 From: lthiry at skynet.be (Lionel Thiry) Date: Mon May 2 13:30:16 2005 Subject: [Rake-devel] Fix for infinite loop bug In-Reply-To: <427653D5.3020409@qwest.com> References: <427653D5.3020409@qwest.com> Message-ID: <427665C8.1060608@skynet.be> Daniel Berger a ?crit : > Hi all, > The failure you see occurs with or without this change, so it's > unrelated. The test in question is: > > assert t.prerequisites.is_a?(FileList) > > I haven't provided any test cases yet because it appears there are still > other places where rake.rb goes into an infinite loop (running > testtasks.rb confirms this). I think it's coming from > create_timed_files atm. > > I'll patch 'em as I see 'em. > > Regards, > > Dan Found it! In test/filecreation.rb, at line 19, it is: File.new(name).mtime Replace it with: File.stat(name).mtime And there is no more loop. Explanation (AFAIK): File.new(name) creates a IO object that isn't closed just after requiring mtime. It will be closed when the garbarge collector collects it, as explained here http://www.ruby-doc.org/core/classes/IO.html#M001187 . But until then, further IO manipulation are impossible, hence all the permission denied in the create_timed_files loop. I've put in attachment the output of the now working unittest. A lot of tests still fails on my computer (win2k), but it doesn't loop anymore. -- Lionel Thiry Personal website: http://users.skynet.be/lthiry/ -------------- next part -------------- C:\usr\ruby\lib\ruby\gems\1.8\gems\rake-0.5.4> rake (in C:/usr/ruby/lib/ruby/gems/1.8/gems/rake-0.5.4) UNABLE TO RUN FUNCTIONAL TESTS No Session Found Loaded suite c:/usr/ruby/lib/ruby/gems/1.8/gems/rake-0.5.4/lib/rake/rake_test_loader Started EEEEEEEEEEEE......EE........................................EEEE....-e:1:in `exit': no implicit conversion from nil to integer (TypeError) from -e:1 FE.EF.......E....EEEEEEEEEEEE............... Finished in 0.671 seconds. 1) Error: test_dry_run(FunctionalTest): Errno::ENOENT: No such file or directory - test/data/default ./test/functional.rb:77:in `chdir' ./test/functional.rb:77:in `test_dry_run' 2) Error: test_dry_run_bug(FunctionalTest): Errno::ENOENT: No such file or directory - test/data/dryrun ./test/functional.rb:86:in `chdir' ./test/functional.rb:86:in `test_dry_run_bug' 3) Error: test_env_availabe_at_task_scope(FunctionalTest): Errno::ENOENT: No such file or directory - test/data/default ./test/functional.rb:54:in `chdir' ./test/functional.rb:54:in `test_env_availabe_at_task_scope' 4) Error: test_env_availabe_at_top_scope(FunctionalTest): Errno::ENOENT: No such file or directory - test/data/default ./test/functional.rb:48:in `chdir' ./test/functional.rb:48:in `test_env_availabe_at_top_scope' 5) Error: test_imports(FunctionalTest): Errno::ENOENT: No such file or directory - test/data/imports ./test/functional.rb:104:in `chdir' ./test/functional.rb:104:in `test_imports' 6) Error: test_multi_desc(FunctionalTest): Errno::ENOENT: No such file or directory - test/data/multidesc ./test/functional.rb:60:in `chdir' ./test/functional.rb:60:in `test_multi_desc' 7) Error: test_nosearch(FunctionalTest): Errno::ENOENT: No such file or directory - test/data/nosearch ./test/functional.rb:72:in `chdir' ./test/functional.rb:72:in `test_nosearch' 8) Error: test_rake_default(FunctionalTest): Errno::ENOENT: No such file or directory - test/data/default ./test/functional.rb:36:in `chdir' ./test/functional.rb:36:in `test_rake_default' 9) Error: test_rake_error_on_bad_task(FunctionalTest): Errno::ENOENT: No such file or directory - test/data/default ./test/functional.rb:42:in `chdir' ./test/functional.rb:42:in `test_rake_error_on_bad_task' 10) Error: test_rbext(FunctionalTest): NameError: uninitialized constant Session::Shell ./test/functional.rb:125:in `rake' ./test/functional.rb:67:in `test_rbext' ./test/functional.rb:67:in `chdir' ./test/functional.rb:67:in `test_rbext' 11) Error: test_rules_chaining_to_file_task(FunctionalTest): Errno::ENOENT: No such file or directory - test/data/chains ./test/functional.rb:115:in `chdir' ./test/functional.rb:115:in `test_rules_chaining_to_file_task' 12) Error: test_trace_bug(FunctionalTest): Errno::ENOENT: No such file or directory - test/data/dryrun ./test/functional.rb:95:in `chdir' ./test/functional.rb:95:in `test_trace_bug' 13) Error: test_directory(TestDirectoryTask): Errno::EACCES: Permission denied - testdata/new c:/usr/ruby/lib/ruby/1.8/fileutils.rb:687:in `unlink' c:/usr/ruby/lib/ruby/1.8/fileutils.rb:687:in `remove_file' ./lib/rake.rb:558:in `remove_file' c:/usr/ruby/lib/ruby/1.8/fileutils.rb:710:in `remove_dir' c:/usr/ruby/lib/ruby/1.8/fileutils.rb:702:in `foreach' c:/usr/ruby/lib/ruby/1.8/fileutils.rb:702:in `remove_dir' ./lib/rake.rb:558:in `remove_dir' c:/usr/ruby/lib/ruby/1.8/fileutils.rb:663:in `rm_r' c:/usr/ruby/lib/ruby/1.8/fileutils.rb:655:in `each' c:/usr/ruby/lib/ruby/1.8/fileutils.rb:655:in `rm_r' ./lib/rake.rb:563:in `rm_r' ./lib/rake.rb:558:in `rm_r' c:/usr/ruby/lib/ruby/1.8/fileutils.rb:679:in `rm_rf' ./lib/rake.rb:563:in `rm_rf' ./lib/rake.rb:558:in `rm_rf' ./test/testtasks.rb:158:in `setup' 14) Error: test_directory(TestDirectoryTask): Errno::EACCES: Permission denied - testdata/new c:/usr/ruby/lib/ruby/1.8/fileutils.rb:687:in `unlink' c:/usr/ruby/lib/ruby/1.8/fileutils.rb:687:in `remove_file' ./lib/rake.rb:558:in `remove_file' c:/usr/ruby/lib/ruby/1.8/fileutils.rb:710:in `remove_dir' c:/usr/ruby/lib/ruby/1.8/fileutils.rb:702:in `foreach' c:/usr/ruby/lib/ruby/1.8/fileutils.rb:702:in `remove_dir' ./lib/rake.rb:558:in `remove_dir' c:/usr/ruby/lib/ruby/1.8/fileutils.rb:663:in `rm_r' c:/usr/ruby/lib/ruby/1.8/fileutils.rb:655:in `each' c:/usr/ruby/lib/ruby/1.8/fileutils.rb:655:in `rm_r' ./lib/rake.rb:563:in `rm_r' ./lib/rake.rb:558:in `rm_r' c:/usr/ruby/lib/ruby/1.8/fileutils.rb:679:in `rm_rf' ./lib/rake.rb:563:in `rm_rf' ./lib/rake.rb:558:in `rm_rf' ./test/testtasks.rb:162:in `teardown' 15) Error: test_file_depends_on_task_depend_on_file(TestFileTask): Errno::EACCES: Permission denied - testdata/new c:/usr/ruby/lib/ruby/1.8/fileutils.rb:687:in `unlink' c:/usr/ruby/lib/ruby/1.8/fileutils.rb:687:in `remove_file' c:/usr/ruby/lib/ruby/1.8/fileutils.rb:618:in `rm' c:/usr/ruby/lib/ruby/1.8/fileutils.rb:617:in `each' c:/usr/ruby/lib/ruby/1.8/fileutils.rb:617:in `rm' c:/usr/ruby/lib/ruby/1.8/fileutils.rb:634:in `rm_f' ./test/testtasks.rb:83:in `setup' 16) Error: test_file_need(TestFileTask): Errno::EACCES: Permission denied - testdata/new c:/usr/ruby/lib/ruby/1.8/fileutils.rb:687:in `unlink' c:/usr/ruby/lib/ruby/1.8/fileutils.rb:687:in `remove_file' c:/usr/ruby/lib/ruby/1.8/fileutils.rb:618:in `rm' c:/usr/ruby/lib/ruby/1.8/fileutils.rb:617:in `each' c:/usr/ruby/lib/ruby/1.8/fileutils.rb:617:in `rm' c:/usr/ruby/lib/ruby/1.8/fileutils.rb:634:in `rm_f' ./test/testtasks.rb:83:in `setup' 17) Error: test_file_times_new_depends_on_old(TestFileTask): Errno::EACCES: Permission denied - testdata/new c:/usr/ruby/lib/ruby/1.8/fileutils.rb:687:in `unlink' c:/usr/ruby/lib/ruby/1.8/fileutils.rb:687:in `remove_file' c:/usr/ruby/lib/ruby/1.8/fileutils.rb:618:in `rm' c:/usr/ruby/lib/ruby/1.8/fileutils.rb:617:in `each' c:/usr/ruby/lib/ruby/1.8/fileutils.rb:617:in `rm' c:/usr/ruby/lib/ruby/1.8/fileutils.rb:634:in `rm_f' ./test/testtasks.rb:83:in `setup' 18) Error: test_file_times_old_depends_on_new(TestFileTask): Errno::EACCES: Permission denied - testdata/new c:/usr/ruby/lib/ruby/1.8/fileutils.rb:687:in `unlink' c:/usr/ruby/lib/ruby/1.8/fileutils.rb:687:in `remove_file' c:/usr/ruby/lib/ruby/1.8/fileutils.rb:618:in `rm' c:/usr/ruby/lib/ruby/1.8/fileutils.rb:617:in `each' c:/usr/ruby/lib/ruby/1.8/fileutils.rb:617:in `rm' c:/usr/ruby/lib/ruby/1.8/fileutils.rb:634:in `rm_f' ./test/testtasks.rb:83:in `setup' 19) Failure: test_ruby(TestFileUtils) [./test/testfileutils.rb:101:in `test_ruby' ./test/testfileutils.rb:99:in `call' ./lib/rake.rb:492:in `sh' ./lib/rake.rb:563:in `sh' ./lib/rake.rb:558:in `sh' ./lib/rake.rb:510:in `ruby' ./lib/rake.rb:563:in `ruby' ./lib/rake.rb:558:in `ruby' ./test/testfileutils.rb:99:in `test_ruby' ./test/testfileutils.rb:95:in `verbose' ./test/testfileutils.rb:95:in `test_ruby']: <123> expected but was <1>. 20) Error: test_sh(TestFileUtils): RuntimeError: Command failed with status (1): [test/shellcommand.rb] ./lib/rake.rb:485:in `sh' ./lib/rake.rb:484:in `call' ./lib/rake.rb:492:in `sh' ./lib/rake.rb:563:in `sh' ./lib/rake.rb:558:in `sh' ./test/testfileutils.rb:56:in `test_sh' ./test/testfileutils.rb:56:in `verbose' ./test/testfileutils.rb:56:in `test_sh' 21) Error: test_sh_multiple_arguments(TestFileUtils): RuntimeError: Command failed with status (1): [test $RAKE_TEST_SH = someval] ./lib/rake.rb:485:in `sh' ./lib/rake.rb:484:in `call' ./lib/rake.rb:492:in `sh' ./lib/rake.rb:563:in `sh' ./lib/rake.rb:558:in `sh' ./test/testfileutils.rb:63:in `test_sh_multiple_arguments' ./test/testfileutils.rb:63:in `verbose' ./test/testfileutils.rb:63:in `test_sh_multiple_arguments' 22) Failure: test_sh_special_handling(TestFileUtils) [./test/testfileutils.rb:81:in `test_sh_special_handling' ./test/testfileutils.rb:80:in `call' ./lib/rake.rb:492:in `sh' ./lib/rake.rb:563:in `sh' ./lib/rake.rb:558:in `sh' ./test/testfileutils.rb:80:in `test_sh_special_handling' ./test/testfileutils.rb:79:in `verbose' ./test/testfileutils.rb:79:in `test_sh_special_handling']: is not true. 23) Error: test_create(TestMakefileLoader): Errno::ENOENT: No such file or directory - test/data/sample.mf ./lib/rake/loaders/makefile.rb:11:in `initialize' ./lib/rake/loaders/makefile.rb:11:in `open' ./lib/rake/loaders/makefile.rb:11:in `load' ./test/test_makefile_loader.rb:11:in `test_create' 24) Error: test_create_by_string(TestRules): Errno::EACCES: Permission denied - testdata/new c:/usr/ruby/lib/ruby/1.8/fileutils.rb:687:in `unlink' c:/usr/ruby/lib/ruby/1.8/fileutils.rb:687:in `remove_file' ./lib/rake.rb:558:in `remove_file' c:/usr/ruby/lib/ruby/1.8/fileutils.rb:664:in `rm_r' c:/usr/ruby/lib/ruby/1.8/fileutils.rb:655:in `each' c:/usr/ruby/lib/ruby/1.8/fileutils.rb:655:in `rm_r' ./lib/rake.rb:563:in `rm_r' ./lib/rake.rb:558:in `rm_r' ./test/testtasks.rb:271:in `teardown' ./test/testtasks.rb:271:in `each' ./lib/rake.rb:750:in `send' ./lib/rake.rb:750:in `each' ./test/testtasks.rb:271:in `teardown' 25) Error: test_create_with_source(TestRules): Errno::EACCES: Permission denied - testdata/new c:/usr/ruby/lib/ruby/1.8/fileutils.rb:687:in `unlink' c:/usr/ruby/lib/ruby/1.8/fileutils.rb:687:in `remove_file' ./lib/rake.rb:558:in `remove_file' c:/usr/ruby/lib/ruby/1.8/fileutils.rb:664:in `rm_r' c:/usr/ruby/lib/ruby/1.8/fileutils.rb:655:in `each' c:/usr/ruby/lib/ruby/1.8/fileutils.rb:655:in `rm_r' ./lib/rake.rb:563:in `rm_r' ./lib/rake.rb:558:in `rm_r' ./test/testtasks.rb:271:in `teardown' ./test/testtasks.rb:271:in `each' ./lib/rake.rb:750:in `send' ./lib/rake.rb:750:in `each' ./test/testtasks.rb:271:in `teardown' 26) Error: test_multiple_rules1(TestRules): Errno::EACCES: Permission denied - testdata/new c:/usr/ruby/lib/ruby/1.8/fileutils.rb:687:in `unlink' c:/usr/ruby/lib/ruby/1.8/fileutils.rb:687:in `remove_file' ./lib/rake.rb:558:in `remove_file' c:/usr/ruby/lib/ruby/1.8/fileutils.rb:664:in `rm_r' c:/usr/ruby/lib/ruby/1.8/fileutils.rb:655:in `each' c:/usr/ruby/lib/ruby/1.8/fileutils.rb:655:in `rm_r' ./lib/rake.rb:563:in `rm_r' ./lib/rake.rb:558:in `rm_r' ./test/testtasks.rb:271:in `teardown' ./test/testtasks.rb:271:in `each' ./lib/rake.rb:750:in `send' ./lib/rake.rb:750:in `each' ./test/testtasks.rb:271:in `teardown' 27) Error: test_multiple_rules2(TestRules): Errno::EACCES: Permission denied - testdata/new c:/usr/ruby/lib/ruby/1.8/fileutils.rb:687:in `unlink' c:/usr/ruby/lib/ruby/1.8/fileutils.rb:687:in `remove_file' ./lib/rake.rb:558:in `remove_file' c:/usr/ruby/lib/ruby/1.8/fileutils.rb:664:in `rm_r' c:/usr/ruby/lib/ruby/1.8/fileutils.rb:655:in `each' c:/usr/ruby/lib/ruby/1.8/fileutils.rb:655:in `rm_r' ./lib/rake.rb:563:in `rm_r' ./lib/rake.rb:558:in `rm_r' ./test/testtasks.rb:271:in `teardown' ./test/testtasks.rb:271:in `each' ./lib/rake.rb:750:in `send' ./lib/rake.rb:750:in `each' ./test/testtasks.rb:271:in `teardown' 28) Error: test_precedence_rule_vs_implicit(TestRules): Errno::EACCES: Permission denied - testdata/new c:/usr/ruby/lib/ruby/1.8/fileutils.rb:687:in `unlink' c:/usr/ruby/lib/ruby/1.8/fileutils.rb:687:in `remove_file' ./lib/rake.rb:558:in `remove_file' c:/usr/ruby/lib/ruby/1.8/fileutils.rb:664:in `rm_r' c:/usr/ruby/lib/ruby/1.8/fileutils.rb:655:in `each' c:/usr/ruby/lib/ruby/1.8/fileutils.rb:655:in `rm_r' ./lib/rake.rb:563:in `rm_r' ./lib/rake.rb:558:in `rm_r' ./test/testtasks.rb:271:in `teardown' ./test/testtasks.rb:271:in `each' ./lib/rake.rb:750:in `send' ./lib/rake.rb:750:in `each' ./test/testtasks.rb:271:in `teardown' 29) Error: test_proc_dependent(TestRules): Errno::EACCES: Permission denied - testdata/new c:/usr/ruby/lib/ruby/1.8/fileutils.rb:687:in `unlink' c:/usr/ruby/lib/ruby/1.8/fileutils.rb:687:in `remove_file' ./lib/rake.rb:558:in `remove_file' c:/usr/ruby/lib/ruby/1.8/fileutils.rb:664:in `rm_r' c:/usr/ruby/lib/ruby/1.8/fileutils.rb:655:in `each' c:/usr/ruby/lib/ruby/1.8/fileutils.rb:655:in `rm_r' ./lib/rake.rb:563:in `rm_r' ./lib/rake.rb:558:in `rm_r' ./test/testtasks.rb:271:in `teardown' ./test/testtasks.rb:271:in `each' ./lib/rake.rb:750:in `send' ./lib/rake.rb:750:in `each' ./test/testtasks.rb:271:in `teardown' 30) Error: test_recursive_overflow(TestRules): Errno::EACCES: Permission denied - testdata/new c:/usr/ruby/lib/ruby/1.8/fileutils.rb:687:in `unlink' c:/usr/ruby/lib/ruby/1.8/fileutils.rb:687:in `remove_file' ./lib/rake.rb:558:in `remove_file' c:/usr/ruby/lib/ruby/1.8/fileutils.rb:664:in `rm_r' c:/usr/ruby/lib/ruby/1.8/fileutils.rb:655:in `each' c:/usr/ruby/lib/ruby/1.8/fileutils.rb:655:in `rm_r' ./lib/rake.rb:563:in `rm_r' ./lib/rake.rb:558:in `rm_r' ./test/testtasks.rb:271:in `teardown' ./test/testtasks.rb:271:in `each' ./lib/rake.rb:750:in `send' ./lib/rake.rb:750:in `each' ./test/testtasks.rb:271:in `teardown' 31) Error: test_recursive_rules(TestRules): Errno::EACCES: Permission denied - testdata/new c:/usr/ruby/lib/ruby/1.8/fileutils.rb:687:in `unlink' c:/usr/ruby/lib/ruby/1.8/fileutils.rb:687:in `remove_file' ./lib/rake.rb:558:in `remove_file' c:/usr/ruby/lib/ruby/1.8/fileutils.rb:664:in `rm_r' c:/usr/ruby/lib/ruby/1.8/fileutils.rb:655:in `each' c:/usr/ruby/lib/ruby/1.8/fileutils.rb:655:in `rm_r' ./lib/rake.rb:563:in `rm_r' ./lib/rake.rb:558:in `rm_r' ./test/testtasks.rb:271:in `teardown' ./test/testtasks.rb:271:in `each' ./lib/rake.rb:750:in `send' ./lib/rake.rb:750:in `each' ./test/testtasks.rb:271:in `teardown' 32) Error: test_rule_and_no_action_task(TestRules): Errno::EACCES: Permission denied - testdata/new c:/usr/ruby/lib/ruby/1.8/fileutils.rb:687:in `unlink' c:/usr/ruby/lib/ruby/1.8/fileutils.rb:687:in `remove_file' ./lib/rake.rb:558:in `remove_file' c:/usr/ruby/lib/ruby/1.8/fileutils.rb:664:in `rm_r' c:/usr/ruby/lib/ruby/1.8/fileutils.rb:655:in `each' c:/usr/ruby/lib/ruby/1.8/fileutils.rb:655:in `rm_r' ./lib/rake.rb:563:in `rm_r' ./lib/rake.rb:558:in `rm_r' ./test/testtasks.rb:271:in `teardown' ./test/testtasks.rb:271:in `each' ./lib/rake.rb:750:in `send' ./lib/rake.rb:750:in `each' ./test/testtasks.rb:271:in `teardown' 33) Error: test_single_dependent(TestRules): Errno::EACCES: Permission denied - testdata/new c:/usr/ruby/lib/ruby/1.8/fileutils.rb:687:in `unlink' c:/usr/ruby/lib/ruby/1.8/fileutils.rb:687:in `remove_file' ./lib/rake.rb:558:in `remove_file' c:/usr/ruby/lib/ruby/1.8/fileutils.rb:664:in `rm_r' c:/usr/ruby/lib/ruby/1.8/fileutils.rb:655:in `each' c:/usr/ruby/lib/ruby/1.8/fileutils.rb:655:in `rm_r' ./lib/rake.rb:563:in `rm_r' ./lib/rake.rb:558:in `rm_r' ./test/testtasks.rb:271:in `teardown' ./test/testtasks.rb:271:in `each' ./lib/rake.rb:750:in `send' ./lib/rake.rb:750:in `each' ./test/testtasks.rb:271:in `teardown' 34) Error: test_string_close_matches(TestRules): Errno::EACCES: Permission denied - testdata/new c:/usr/ruby/lib/ruby/1.8/fileutils.rb:687:in `unlink' c:/usr/ruby/lib/ruby/1.8/fileutils.rb:687:in `remove_file' ./lib/rake.rb:558:in `remove_file' c:/usr/ruby/lib/ruby/1.8/fileutils.rb:664:in `rm_r' c:/usr/ruby/lib/ruby/1.8/fileutils.rb:655:in `each' c:/usr/ruby/lib/ruby/1.8/fileutils.rb:655:in `rm_r' ./lib/rake.rb:563:in `rm_r' ./lib/rake.rb:558:in `rm_r' ./test/testtasks.rb:271:in `teardown' ./test/testtasks.rb:271:in `each' ./lib/rake.rb:750:in `send' ./lib/rake.rb:750:in `each' ./test/testtasks.rb:271:in `teardown' 35) Error: test_too_many_dependents(TestRules): Errno::EACCES: Permission denied - testdata/new c:/usr/ruby/lib/ruby/1.8/fileutils.rb:687:in `unlink' c:/usr/ruby/lib/ruby/1.8/fileutils.rb:687:in `remove_file' ./lib/rake.rb:558:in `remove_file' c:/usr/ruby/lib/ruby/1.8/fileutils.rb:664:in `rm_r' c:/usr/ruby/lib/ruby/1.8/fileutils.rb:655:in `each' c:/usr/ruby/lib/ruby/1.8/fileutils.rb:655:in `rm_r' ./lib/rake.rb:563:in `rm_r' ./lib/rake.rb:558:in `rm_r' ./test/testtasks.rb:271:in `teardown' ./test/testtasks.rb:271:in `each' ./lib/rake.rb:750:in `send' ./lib/rake.rb:750:in `each' ./test/testtasks.rb:271:in `teardown' 111 tests, 296 assertions, 2 failures, 33 errors rake aborted! Command failed with status (1): [ruby -Ilib -w "c:/usr/ruby/lib/ruby/gems/1...] Process rake exited with code 1 C:\usr\ruby\lib\ruby\gems\1.8\gems\rake-0.5.4> From jim at weirichhouse.org Mon May 2 13:50:06 2005 From: jim at weirichhouse.org (Jim Weirich) Date: Mon May 2 13:43:57 2005 Subject: [Rake-devel] Fix for infinite loop bug In-Reply-To: <427665C8.1060608@skynet.be> References: <427653D5.3020409@qwest.com> <427665C8.1060608@skynet.be> Message-ID: <4944.192.223.163.5.1115056206.squirrel@weirichhouse.org> Lionel Thiry said: > Found it! > > In test/filecreation.rb, at line 19, it is: > File.new(name).mtime > Replace it with: > File.stat(name).mtime > > And there is no more loop. Thanks! I'll commit this sometime tonight (I hope ... busy evening ahead). -- -- Jim Weirich jim@weirichhouse.org http://onestepback.org ----------------------------------------------------------------- "Beware of bugs in the above code; I have only proved it correct, not tried it." -- Donald Knuth (in a memo to Peter van Emde Boas) From Daniel.Berger at qwest.com Mon May 2 15:02:51 2005 From: Daniel.Berger at qwest.com (Berger, Daniel) Date: Mon May 2 14:56:43 2005 Subject: [Rake-devel] testtasks.rb failure Message-ID: <8FE83020B9E1A248A182A9B0A7B76E73015E6B79@itomae2km07.AD.QINTRA.COM> Hi all, I add this test to testtasks.rb for future use if you like: def test_directory_win32 desc "WIN32 DESC" directory 'c:\testdata\a\b\c' assert_equal FileTask, Task['c:\testdata'].class assert_equal FileTask, Task['c:\testdata\a'].class assert_equal FileTask, Task['c:\testdata\a\b\c'].class assert_nil Task['c:\testdata'].comment assert_equal "WIN32 DESC", Task['c:\testdata\a\b\c'].comment assert_nil Task['c:\testdata\a\b'].comment verbose(false) { Task['c:\testdata\a\b'].invoke } assert File.exist?('c:\testdata\a\b') assert ! File.exist?('c:\testdata\a\b\c') end After applying Lionel's patch, all tests pass for testtasks.rb: C:\ruby\lib\ruby\gems\1.8\gems\rake-0.5.4\test>ruby testtasks.rb Loaded suite testtasks Started .............................. Finished in 3.705 seconds. 30 tests, 77 assertions, 0 failures, 0 errors Lionel, are you still seeing failures? Regards, Dan From Daniel.Berger at qwest.com Mon May 2 15:05:03 2005 From: Daniel.Berger at qwest.com (Berger, Daniel) Date: Mon May 2 14:58:55 2005 Subject: [Rake-devel] testtasks.rb success Message-ID: <8FE83020B9E1A248A182A9B0A7B76E73015E6B7A@itomae2km07.AD.QINTRA.COM> Subject changed to reflect content ;) Dan From Daniel.Berger at qwest.com Mon May 2 15:18:30 2005 From: Daniel.Berger at qwest.com (Berger, Daniel) Date: Mon May 2 15:12:23 2005 Subject: [Rake-devel] Test organization Message-ID: <8FE83020B9E1A248A182A9B0A7B76E73015E6B7B@itomae2km07.AD.QINTRA.COM> Hi all, I have a few suggestions for the test suite: 1) Please move each test case into its own file. Having multiple test cases in the same file is confusing the heck out of me. 2) Add this bit of code to the top of each test file: base = File.basename(Dir.pwd) if base == "test" || base =~ /rake.*/ require "ftools" Dir.chdir("..") if base == "test" $LOAD_PATH.unshift(Dir.pwd) $LOAD_PATH.unshift(Dir.pwd + "/lib") $LOAD_PATH.unshift(Dir.pwd + "/lib/rake") Dir.chdir("test") end This does a couple things. First, tweaking the $LOAD_PATH ensures that you're testing against the current version instead of a previously installed version you might have laying around. Second, it lets me run the tests from either the base rake directory or from within the test directory, i.e. "ruby test\testtasks.rb" (from the base rake directory) or "ruby testtasks.rb" (from within rake\test). 3) Give me a test_all.rb that allows me to run all tests at once. Or is there something like that already? I didn't see it. 4) Nitpick: can we please put underscores in the test file names? e.g. test_tasks.rb instead of testtasks.rb. It's just easier on my eyes. :) Regards, Dan From jim at weirichhouse.org Mon May 2 16:29:30 2005 From: jim at weirichhouse.org (Jim Weirich) Date: Mon May 2 16:23:22 2005 Subject: [Rake-devel] Test organization In-Reply-To: <8FE83020B9E1A248A182A9B0A7B76E73015E6B7B@itomae2km07.AD.QINTRA.COM> References: <8FE83020B9E1A248A182A9B0A7B76E73015E6B7B@itomae2km07.AD.QINTRA.COM> Message-ID: <28709.192.223.163.5.1115065770.squirrel@weirichhouse.org> Berger, Daniel said: > Hi all, > > I have a few suggestions for the test suite: > > 1) Please move each test case into its own file. Having multiple test > cases in the same file is confusing the heck out of me. TestTask seems to be the major offender here. The others mostly 1-to-1. > 2) Add this bit of code to the top of each test file: The LOAD_PATH munging is handled by the rake task. I always run the tests via rake so never have to worry about this. Also rake deals with the "run from any directory issue" as well. If you want to run just one test file, e.g. ruby test\testtasks.rb, do this: rake test TEST=test/testtasks.rb (Unix style command line quoting assumed, change appropriately for windows). > 3) Give me a test_all.rb that allows me to run all tests at once. Or is > there something like that already? I didn't see it. Handled by the Rakefile (see answer to #2). > 4) Nitpick: can we please put underscores in the test file names? e.g. > test_tasks.rb instead of testtasks.rb. It's just easier on my eyes. :) Reasonable request. I think I changed my style over time to use underscores where before I didn't. Thanks for the patches, suggestions and help. -- -- Jim Weirich jim@weirichhouse.org http://onestepback.org ----------------------------------------------------------------- "Beware of bugs in the above code; I have only proved it correct, not tried it." -- Donald Knuth (in a memo to Peter van Emde Boas) From lthiry at skynet.be Mon May 2 17:36:14 2005 From: lthiry at skynet.be (Lionel Thiry) Date: Mon May 2 17:27:07 2005 Subject: [Rake-devel] testtasks.rb failure In-Reply-To: <8FE83020B9E1A248A182A9B0A7B76E73015E6B79@itomae2km07.AD.QINTRA.COM> References: <8FE83020B9E1A248A182A9B0A7B76E73015E6B79@itomae2km07.AD.QINTRA.COM> Message-ID: <42769D4E.9080809@skynet.be> Berger, Daniel a ?crit : > Hi all, > > I add this test to testtasks.rb for future use if you like: > > def test_directory_win32 > desc "WIN32 DESC" > directory 'c:\testdata\a\b\c' > assert_equal FileTask, Task['c:\testdata'].class > assert_equal FileTask, Task['c:\testdata\a'].class > assert_equal FileTask, Task['c:\testdata\a\b\c'].class > assert_nil Task['c:\testdata'].comment > assert_equal "WIN32 DESC", Task['c:\testdata\a\b\c'].comment > assert_nil Task['c:\testdata\a\b'].comment > verbose(false) { > Task['c:\testdata\a\b'].invoke > } > assert File.exist?('c:\testdata\a\b') > assert ! File.exist?('c:\testdata\a\b\c') > end > > After applying Lionel's patch, all tests pass for testtasks.rb: > > C:\ruby\lib\ruby\gems\1.8\gems\rake-0.5.4\test>ruby testtasks.rb > Loaded suite testtasks > Started > .............................. > Finished in 3.705 seconds. > > 30 tests, 77 assertions, 0 failures, 0 errors > > Lionel, are you still seeing failures? > > Regards, > > Dan > Yes, testasks alone works perfectly: ----8<---- C:\usr\ruby\lib\ruby\gems\1.8\gems\rake-0.5.4>rake test TEST=test/testtasks.rb (in C:/usr/ruby/lib/ruby/gems/1.8/gems/rake-0.5.4) C:\usr\ruby\lib\ruby\gems\1.8\gems\rake-0.5.4> ----8<---- I've retested the complete unittesting. I don't understand, I don't have the same output as te one I send before. Must have made a manipulation error last time, sorry. However, I send the new one in attachment: there are still 2 failures and 15 errors (and that weird error occuring /during/ the tests ----8<---- -e:1:in `exit': no implicit conversion from nil to integer (TypeError) from -e:1) ----8<---- ) -- Lionel Thiry Personal website: http://users.skynet.be/lthiry/ -------------- next part -------------- c:\usr\ruby\lib\ruby\gems\1.8\gems\rake-0.5.4> rake (in c:/usr/ruby/lib/ruby/gems/1.8/gems/rake-0.5.4) UNABLE TO RUN FUNCTIONAL TESTS No Session Found Loaded suite c:/usr/ruby/lib/ruby/gems/1.8/gems/rake-0.5.4/lib/rake/rake_test_loader Started EEEEEEEEEEEE.......................................................-e:1:in `exit': no implicit conversion from nil to integer (TypeError) from -e:1 FE.EF.......E............................... Finished in 3.859 seconds. 1) Error: test_dry_run(FunctionalTest): Errno::ENOENT: No such file or directory - test/data/default ./test/functional.rb:77:in `chdir' ./test/functional.rb:77:in `test_dry_run' 2) Error: test_dry_run_bug(FunctionalTest): Errno::ENOENT: No such file or directory - test/data/dryrun ./test/functional.rb:86:in `chdir' ./test/functional.rb:86:in `test_dry_run_bug' 3) Error: test_env_availabe_at_task_scope(FunctionalTest): Errno::ENOENT: No such file or directory - test/data/default ./test/functional.rb:54:in `chdir' ./test/functional.rb:54:in `test_env_availabe_at_task_scope' 4) Error: test_env_availabe_at_top_scope(FunctionalTest): Errno::ENOENT: No such file or directory - test/data/default ./test/functional.rb:48:in `chdir' ./test/functional.rb:48:in `test_env_availabe_at_top_scope' 5) Error: test_imports(FunctionalTest): Errno::ENOENT: No such file or directory - test/data/imports ./test/functional.rb:104:in `chdir' ./test/functional.rb:104:in `test_imports' 6) Error: test_multi_desc(FunctionalTest): Errno::ENOENT: No such file or directory - test/data/multidesc ./test/functional.rb:60:in `chdir' ./test/functional.rb:60:in `test_multi_desc' 7) Error: test_nosearch(FunctionalTest): Errno::ENOENT: No such file or directory - test/data/nosearch ./test/functional.rb:72:in `chdir' ./test/functional.rb:72:in `test_nosearch' 8) Error: test_rake_default(FunctionalTest): Errno::ENOENT: No such file or directory - test/data/default ./test/functional.rb:36:in `chdir' ./test/functional.rb:36:in `test_rake_default' 9) Error: test_rake_error_on_bad_task(FunctionalTest): Errno::ENOENT: No such file or directory - test/data/default ./test/functional.rb:42:in `chdir' ./test/functional.rb:42:in `test_rake_error_on_bad_task' 10) Error: test_rbext(FunctionalTest): NameError: uninitialized constant Session::Shell ./test/functional.rb:125:in `rake' ./test/functional.rb:67:in `test_rbext' ./test/functional.rb:67:in `chdir' ./test/functional.rb:67:in `test_rbext' 11) Error: test_rules_chaining_to_file_task(FunctionalTest): Errno::ENOENT: No such file or directory - test/data/chains ./test/functional.rb:115:in `chdir' ./test/functional.rb:115:in `test_rules_chaining_to_file_task' 12) Error: test_trace_bug(FunctionalTest): Errno::ENOENT: No such file or directory - test/data/dryrun ./test/functional.rb:95:in `chdir' ./test/functional.rb:95:in `test_trace_bug' 13) Failure: test_ruby(TestFileUtils) [./test/testfileutils.rb:101:in `test_ruby' ./test/testfileutils.rb:99:in `call' ./lib/rake.rb:492:in `sh' ./lib/rake.rb:563:in `sh' ./lib/rake.rb:558:in `sh' ./lib/rake.rb:510:in `ruby' ./lib/rake.rb:563:in `ruby' ./lib/rake.rb:558:in `ruby' ./test/testfileutils.rb:99:in `test_ruby' ./test/testfileutils.rb:95:in `verbose' ./test/testfileutils.rb:95:in `test_ruby']: <123> expected but was <1>. 14) Error: test_sh(TestFileUtils): RuntimeError: Command failed with status (1): [test/shellcommand.rb] ./lib/rake.rb:485:in `sh' ./lib/rake.rb:484:in `call' ./lib/rake.rb:492:in `sh' ./lib/rake.rb:563:in `sh' ./lib/rake.rb:558:in `sh' ./test/testfileutils.rb:56:in `test_sh' ./test/testfileutils.rb:56:in `verbose' ./test/testfileutils.rb:56:in `test_sh' 15) Error: test_sh_multiple_arguments(TestFileUtils): RuntimeError: Command failed with status (1): [test $RAKE_TEST_SH = someval] ./lib/rake.rb:485:in `sh' ./lib/rake.rb:484:in `call' ./lib/rake.rb:492:in `sh' ./lib/rake.rb:563:in `sh' ./lib/rake.rb:558:in `sh' ./test/testfileutils.rb:63:in `test_sh_multiple_arguments' ./test/testfileutils.rb:63:in `verbose' ./test/testfileutils.rb:63:in `test_sh_multiple_arguments' 16) Failure: test_sh_special_handling(TestFileUtils) [./test/testfileutils.rb:81:in `test_sh_special_handling' ./test/testfileutils.rb:80:in `call' ./lib/rake.rb:492:in `sh' ./lib/rake.rb:563:in `sh' ./lib/rake.rb:558:in `sh' ./test/testfileutils.rb:80:in `test_sh_special_handling' ./test/testfileutils.rb:79:in `verbose' ./test/testfileutils.rb:79:in `test_sh_special_handling']: is not true. 17) Error: test_create(TestMakefileLoader): Errno::ENOENT: No such file or directory - test/data/sample.mf ./lib/rake/loaders/makefile.rb:11:in `initialize' ./lib/rake/loaders/makefile.rb:11:in `open' ./lib/rake/loaders/makefile.rb:11:in `load' ./test/test_makefile_loader.rb:11:in `test_create' 111 tests, 315 assertions, 2 failures, 15 errors rake aborted! Command failed with status (1): [ruby -Ilib -w "c:/usr/ruby/lib/ruby/gems/1...] Process rake exited with code 1 From lthiry at skynet.be Mon May 2 18:04:21 2005 From: lthiry at skynet.be (Lionel Thiry) Date: Mon May 2 17:55:08 2005 Subject: [Rake-devel] testtasks.rb failure In-Reply-To: <42769D4E.9080809@skynet.be> References: <8FE83020B9E1A248A182A9B0A7B76E73015E6B79@itomae2km07.AD.QINTRA.COM> <42769D4E.9080809@skynet.be> Message-ID: <4276A3E5.8000702@skynet.be> We can see in the beginning of the output ----8<---- c:\usr\ruby\lib\ruby\gems\1.8\gems\rake-0.5.4> rake (in c:/usr/ruby/lib/ruby/gems/1.8/gems/rake-0.5.4) UNABLE TO RUN FUNCTIONAL TESTS No Session Found Loaded suite c:/usr/ruby/lib/ruby/gems/1.8/gems/rake-0.5.4/lib/rake/rake_test_loader Started ... ----8<---- But those functional tests *are* run. And fails, as the files they need aren't written yet. I've modfied test/functional.rb so that ----8<---- begin require 'rubygems' require_gem 'session' rescue LoadError puts "UNABLE TO RUN FUNCTIONAL TESTS" puts "No Session Found" end ----8<---- is split into two parts, with ----8<---- begin require 'rubygems' require_gem 'session' ----8<---- in the beginning of test/functionnal.rb, and ----8<---- rescue LoadError puts "UNABLE TO RUN FUNCTIONAL TESTS" puts "No Session Found" end ----8<---- at the end. So the tests are truly skipped on a LoadError. (sorry, I could not find a better way, I'm a newbie after all: only one year and half of ruby use. I'm also sorry I don't know how to easily use diff on windows to provide patches) I've put the new output as attachment. The error about the missing test/data/sample.mf is right: I have no such file. Is it normal? -- Lionel Thiry Personal website: http://users.skynet.be/lthiry/ -------------- next part -------------- c:\usr\ruby\lib\ruby\gems\1.8\gems\rake-0.5.4> rake (in c:/usr/ruby/lib/ruby/gems/1.8/gems/rake-0.5.4) UNABLE TO RUN FUNCTIONAL TESTS No Session Found Loaded suite c:/usr/ruby/lib/ruby/gems/1.8/gems/rake-0.5.4/lib/rake/rake_test_loader Started .......................................................-e:1:in `exit': no implicit conversion from nil to integer (TypeError) from -e:1 FE.EF.......E............................... Finished in 3.734 seconds. 1) Failure: test_ruby(TestFileUtils) [./test/testfileutils.rb:101:in `test_ruby' ./test/testfileutils.rb:99:in `call' ./lib/rake.rb:492:in `sh' ./lib/rake.rb:563:in `sh' ./lib/rake.rb:558:in `sh' ./lib/rake.rb:510:in `ruby' ./lib/rake.rb:563:in `ruby' ./lib/rake.rb:558:in `ruby' ./test/testfileutils.rb:99:in `test_ruby' ./test/testfileutils.rb:95:in `verbose' ./test/testfileutils.rb:95:in `test_ruby']: <123> expected but was <1>. 2) Error: test_sh(TestFileUtils): RuntimeError: Command failed with status (1): [test/shellcommand.rb] ./lib/rake.rb:485:in `sh' ./lib/rake.rb:484:in `call' ./lib/rake.rb:492:in `sh' ./lib/rake.rb:563:in `sh' ./lib/rake.rb:558:in `sh' ./test/testfileutils.rb:56:in `test_sh' ./test/testfileutils.rb:56:in `verbose' ./test/testfileutils.rb:56:in `test_sh' 3) Error: test_sh_multiple_arguments(TestFileUtils): RuntimeError: Command failed with status (1): [test $RAKE_TEST_SH = someval] ./lib/rake.rb:485:in `sh' ./lib/rake.rb:484:in `call' ./lib/rake.rb:492:in `sh' ./lib/rake.rb:563:in `sh' ./lib/rake.rb:558:in `sh' ./test/testfileutils.rb:63:in `test_sh_multiple_arguments' ./test/testfileutils.rb:63:in `verbose' ./test/testfileutils.rb:63:in `test_sh_multiple_arguments' 4) Failure: test_sh_special_handling(TestFileUtils) [./test/testfileutils.rb:81:in `test_sh_special_handling' ./test/testfileutils.rb:80:in `call' ./lib/rake.rb:492:in `sh' ./lib/rake.rb:563:in `sh' ./lib/rake.rb:558:in `sh' ./test/testfileutils.rb:80:in `test_sh_special_handling' ./test/testfileutils.rb:79:in `verbose' ./test/testfileutils.rb:79:in `test_sh_special_handling']: is not true. 5) Error: test_create(TestMakefileLoader): Errno::ENOENT: No such file or directory - test/data/sample.mf ./lib/rake/loaders/makefile.rb:11:in `initialize' ./lib/rake/loaders/makefile.rb:11:in `open' ./lib/rake/loaders/makefile.rb:11:in `load' ./test/test_makefile_loader.rb:11:in `test_create' 99 tests, 315 assertions, 2 failures, 3 errors rake aborted! Command failed with status (1): [ruby -Ilib -w "c:/usr/ruby/lib/ruby/gems/1...] Process rake exited with code 1 c:\usr\ruby\lib\ruby\gems\1.8\gems\rake-0.5.4> From lthiry at skynet.be Mon May 2 18:07:59 2005 From: lthiry at skynet.be (Lionel Thiry) Date: Mon May 2 17:58:49 2005 Subject: [Rake-devel] testtasks.rb failure In-Reply-To: <42769D4E.9080809@skynet.be> References: <8FE83020B9E1A248A182A9B0A7B76E73015E6B79@itomae2km07.AD.QINTRA.COM> <42769D4E.9080809@skynet.be> Message-ID: <4276A4BF.3010406@skynet.be> Lionel Thiry a ?crit : > Berger, Daniel a ?crit : > >> Hi all, >> >> I add this test to testtasks.rb for future use if you like: >> >> def test_directory_win32 >> desc "WIN32 DESC" >> directory 'c:\testdata\a\b\c' >> assert_equal FileTask, Task['c:\testdata'].class >> assert_equal FileTask, Task['c:\testdata\a'].class >> assert_equal FileTask, Task['c:\testdata\a\b\c'].class >> assert_nil Task['c:\testdata'].comment >> assert_equal "WIN32 DESC", Task['c:\testdata\a\b\c'].comment >> assert_nil Task['c:\testdata\a\b'].comment >> verbose(false) { >> Task['c:\testdata\a\b'].invoke >> } >> assert File.exist?('c:\testdata\a\b') >> assert ! File.exist?('c:\testdata\a\b\c') >> end >> >> After applying Lionel's patch, all tests pass for testtasks.rb: >> >> C:\ruby\lib\ruby\gems\1.8\gems\rake-0.5.4\test>ruby testtasks.rb >> Loaded suite testtasks >> Started >> .............................. >> Finished in 3.705 seconds. >> >> 30 tests, 77 assertions, 0 failures, 0 errors >> >> Lionel, are you still seeing failures? >> >> Regards, >> >> Dan >> > > Yes, testasks alone works perfectly: > ----8<---- > C:\usr\ruby\lib\ruby\gems\1.8\gems\rake-0.5.4>rake test TEST=test/testtasks.rb > (in C:/usr/ruby/lib/ruby/gems/1.8/gems/rake-0.5.4) > > C:\usr\ruby\lib\ruby\gems\1.8\gems\rake-0.5.4> > ----8<---- > Perfectly? With no output? testtasks.rb works, I'm sure of it, as my recent tests show it. But is it normal that "rake test TEST=test/testtasks.rb" gives no output? -- Lionel Thiry Personal website: http://users.skynet.be/lthiry/ From djberg96 at yahoo.com Mon May 2 23:58:42 2005 From: djberg96 at yahoo.com (Daniel Berger) Date: Mon May 2 23:52:34 2005 Subject: [Rake-devel] Some tests not deleting testdata Message-ID: <20050503035842.44024.qmail@web50304.mail.yahoo.com> Hi, It looks like not all the tests that create a "testdata" directory are necessarily cleaning it up afterwards in the teardown method, and I think this is messing up some tests. The one I'm looking at is testfilelist.rb, but I think there are others. Regards, Dan __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From jim at weirichhouse.org Tue May 3 00:19:07 2005 From: jim at weirichhouse.org (Jim Weirich) Date: Tue May 3 00:11:34 2005 Subject: [Rake-devel] testtasks.rb failure In-Reply-To: <4276A4BF.3010406@skynet.be> References: <8FE83020B9E1A248A182A9B0A7B76E73015E6B79@itomae2km07.AD.QINTRA.COM> <42769D4E.9080809@skynet.be> <4276A4BF.3010406@skynet.be> Message-ID: <200505030019.07555.jim@weirichhouse.org> On Monday 02 May 2005 06:07 pm, Lionel Thiry wrote: > Perfectly? With no output? > > testtasks.rb works, I'm sure of it, as my recent tests show it. > > But is it normal that "rake test TEST=test/testtasks.rb" gives no output? No, but the problem was mine. I used to have a target named 'test' that ran the unit tests. In a recent fit of organization, I renamed all the test taks to be more descriptive (e.g. alltests, functionaltests) and had a set of short aliases to run them. So task :test no longer exists. When you run it, Rake finds the "test" directory and thinks that task "test" is complete (i.e. the file is built), so it doesn't produce output. I've incorporated the patches on this list and committed them to the Rake CVS. I also made a beta version 0.5.4.1 available at http://onestepback.org/betagems if you want to try it out. Let me know if I missed anything (there was a lot of traffic today). Some random notes: * I included the C: tests for win32. They actually run under unix if forward slashes are used (c: is just treated as a file name, not a device). Coding it with backslashes will fail under unix. I could use a conditional around the test and only run it under windows, but I question the value of having unit tests that are not run on the primary development platform, nor available in any accessible remote testing platform. * I implemented the new directory path algorithm in a separate function that yields partial pathnames. This allowed me to test the algorithm more independently. * I didn't rearrange the test files as was suggested. Its late already, but I hope to get to it soon. Thanks to everyone for their suggestions. -- -- Jim Weirich jim@weirichhouse.org http://onestepback.org ----------------------------------------------------------------- "Beware of bugs in the above code; I have only proved it correct, not tried it." -- Donald Knuth (in a memo to Peter van Emde Boas) From djberge at qwest.com Tue May 3 14:31:13 2005 From: djberge at qwest.com (Daniel Berger) Date: Tue May 3 14:50:24 2005 Subject: [Rake-devel] rake test failures for beta gem Message-ID: <4277C371.9060100@qwest.com> Jim Weirich wrote: > I've incorporated the patches on this list and committed them to the Rake CVS. > I also made a beta version 0.5.4.1 available at > http://onestepback.org/betagems if you want to try it out. Let me know if I > missed anything (there was a lot of traffic today). I installed the beta gem, went to the test directory and ran "rake test" (as root). Here was the result: >rake test (in /usr/local/lib/ruby/gems/1.8/gems/rake-0.5.4.1) mkdir -p testdata Loaded suite /usr/local/lib/ruby/gems/1.8/gems/rake-0.5.4.1/lib/rake/rake_test_loader Started .........................................................E..F.......E............................... Finished in 4.663194 seconds. 1) Error: test_sh(TestFileUtils): RuntimeError: Command failed with status (127): [test/shellcommand.rb] ./lib/rake.rb:484:in `sh' ./lib/rake.rb:483:in `call' ./lib/rake.rb:491:in `sh' ./lib/rake.rb:562:in `sh' ./lib/rake.rb:557:in `sh' ./test/testfileutils.rb:56:in `test_sh' ./test/testfileutils.rb:56:in `verbose' ./test/testfileutils.rb:56:in `test_sh' 2) Failure: test_sh_special_handling(TestFileUtils) [./test/testfileutils.rb:81:in `test_sh_special_handling' ./test/testfileutils.rb:80:in `call' ./lib/rake.rb:491:in `sh' ./lib/rake.rb:562:in `sh' ./lib/rake.rb:557:in `sh' ./test/testfileutils.rb:80:in `test_sh_special_handling' ./test/testfileutils.rb:79:in `verbose' ./test/testfileutils.rb:79:in `test_sh_special_handling']: is not true. 3) Error: test_create(TestMakefileLoader): Errno::ENOENT: No such file or directory - test/data/sample.mf ./lib/rake/loaders/makefile.rb:11:in `initialize' ./lib/rake/loaders/makefile.rb:11:in `open' ./lib/rake/loaders/makefile.rb:11:in `load' ./test/test_makefile_loader.rb:11:in `test_create' 100 tests, 329 assertions, 1 failures, 2 errors rake aborted! Command failed with status (1): [ruby -Ilib -w "/usr/local/lib/ruby/gems/1....] This is Ruby 1.8.2 on Solaris 10 (on a bash shell, if that matters). Regards, Dan From lthiry at skynet.be Wed May 4 20:43:42 2005 From: lthiry at skynet.be (Lionel Thiry) Date: Wed May 4 20:34:32 2005 Subject: [Rake-devel] rake test failures for beta gem In-Reply-To: <4277C371.9060100@qwest.com> References: <4277C371.9060100@qwest.com> Message-ID: <42796C3E.1080003@skynet.be> Hello! Done the same on my win2k platform, under a dos box, run with ruby 1.8.2. Output is given in attachment. Daniel Berger a ?crit : > Jim Weirich wrote: > > > > > I've incorporated the patches on this list and committed them to the > Rake CVS. > > I also made a beta version 0.5.4.1 available at > > http://onestepback.org/betagems if you want to try it out. Let me > know if I > > missed anything (there was a lot of traffic today). > > I installed the beta gem, went to the test directory and ran "rake test" > (as root). Here was the result: > > >rake test > (in /usr/local/lib/ruby/gems/1.8/gems/rake-0.5.4.1) > mkdir -p testdata > Loaded suite > /usr/local/lib/ruby/gems/1.8/gems/rake-0.5.4.1/lib/rake/rake_test_loader > Started > .........................................................E..F.......E............................... > > Finished in 4.663194 seconds. > > 1) Error: > test_sh(TestFileUtils): > RuntimeError: Command failed with status (127): [test/shellcommand.rb] > ./lib/rake.rb:484:in `sh' > ./lib/rake.rb:483:in `call' > ./lib/rake.rb:491:in `sh' > ./lib/rake.rb:562:in `sh' > ./lib/rake.rb:557:in `sh' > ./test/testfileutils.rb:56:in `test_sh' > ./test/testfileutils.rb:56:in `verbose' > ./test/testfileutils.rb:56:in `test_sh' > > 2) Failure: > test_sh_special_handling(TestFileUtils) > [./test/testfileutils.rb:81:in `test_sh_special_handling' > ./test/testfileutils.rb:80:in `call' > ./lib/rake.rb:491:in `sh' > ./lib/rake.rb:562:in `sh' > ./lib/rake.rb:557:in `sh' > ./test/testfileutils.rb:80:in `test_sh_special_handling' > ./test/testfileutils.rb:79:in `verbose' > ./test/testfileutils.rb:79:in `test_sh_special_handling']: > is not true. > > 3) Error: > test_create(TestMakefileLoader): > Errno::ENOENT: No such file or directory - test/data/sample.mf > ./lib/rake/loaders/makefile.rb:11:in `initialize' > ./lib/rake/loaders/makefile.rb:11:in `open' > ./lib/rake/loaders/makefile.rb:11:in `load' > ./test/test_makefile_loader.rb:11:in `test_create' > > 100 tests, 329 assertions, 1 failures, 2 errors > rake aborted! > Command failed with status (1): [ruby -Ilib -w > "/usr/local/lib/ruby/gems/1....] > > This is Ruby 1.8.2 on Solaris 10 (on a bash shell, if that matters). > > Regards, > > Dan > -- Lionel Thiry Personal website: http://users.skynet.be/lthiry/ -------------- next part -------------- C:\usr\ruby\lib\ruby\gems\1.8\gems\rake-0.5.4.1>rake (in C:/usr/ruby/lib/ruby/gems/1.8/gems/rake-0.5.4.1) mkdir -p testdata ruby -Ilib -w "c:/usr/ruby/lib/ruby/gems/1.8/gems/rake-0.5.4.1/lib/rake/rake_tes t_loader.rb" "test/testclean.rb" "test/testfilelist.rb" "test/testfileutils.rb" "test/testftp.rb" "test/testpackagetask.rb" "test/testtasks.rb" "test/testtestta sk.rb" "test/test_makefile_loader.rb" "test/test_rake.rb" "test/contrib/testsys. rb" "test/functional.rb" UNABLE TO RUN FUNCTIONAL TESTS No Session Found Loaded suite c:/usr/ruby/lib/ruby/gems/1.8/gems/rake-0.5.4.1/lib/rake/rake_test_ loader Started ........................................................-e:1:in `exit': no impli cit conversion from nil to integer (TypeError) from -e:1 FE.EF.......E....F........................... Finished in 3.359 seconds. 1) Failure: test_ruby(TestFileUtils) [./test/testfileutils.rb:101:in `test_ruby' ./test/testfileutils.rb:99:in `call' ./lib/rake.rb:491:in `sh' ./lib/rake.rb:562:in `sh' ./lib/rake.rb:557:in `sh' ./lib/rake.rb:509:in `ruby' ./lib/rake.rb:562:in `ruby' ./lib/rake.rb:557:in `ruby' ./test/testfileutils.rb:99:in `test_ruby' ./test/testfileutils.rb:95:in `verbose' ./test/testfileutils.rb:95:in `test_ruby']: <123> expected but was <1>. 2) Error: test_sh(TestFileUtils): RuntimeError: Command failed with status (1): [test/shellcommand.rb] ./lib/rake.rb:484:in `sh' ./lib/rake.rb:483:in `call' ./lib/rake.rb:491:in `sh' ./lib/rake.rb:562:in `sh' ./lib/rake.rb:557:in `sh' ./test/testfileutils.rb:56:in `test_sh' ./test/testfileutils.rb:56:in `verbose' ./test/testfileutils.rb:56:in `test_sh' 3) Error: test_sh_multiple_arguments(TestFileUtils): RuntimeError: Command failed with status (1): [test $RAKE_TEST_SH = someval] ./lib/rake.rb:484:in `sh' ./lib/rake.rb:483:in `call' ./lib/rake.rb:491:in `sh' ./lib/rake.rb:562:in `sh' ./lib/rake.rb:557:in `sh' ./test/testfileutils.rb:63:in `test_sh_multiple_arguments' ./test/testfileutils.rb:63:in `verbose' ./test/testfileutils.rb:63:in `test_sh_multiple_arguments' 4) Failure: test_sh_special_handling(TestFileUtils) [./test/testfileutils.rb:81:in `test_sh_special_handling' ./test/testfileutils.rb:80:in `call' ./lib/rake.rb:491:in `sh' ./lib/rake.rb:562:in `sh' ./lib/rake.rb:557:in `sh' ./test/testfileutils.rb:80:in `test_sh_special_handling' ./test/testfileutils.rb:79:in `verbose' ./test/testfileutils.rb:79:in `test_sh_special_handling']: is not true. 5) Error: test_create(TestMakefileLoader): Errno::ENOENT: No such file or directory - test/data/sample.mf ./lib/rake/loaders/makefile.rb:11:in `initialize' ./lib/rake/loaders/makefile.rb:11:in `open' ./lib/rake/loaders/makefile.rb:11:in `load' ./test/test_makefile_loader.rb:11:in `test_create' 6) Failure: test_each_dir_parent(TestRake) [./test/test_rake.rb:11]: <["c:/a/b", "c:/a", "c:"]> expected but was <["c:/a/b", "c:/a", "c:/"]>. 101 tests, 328 assertions, 3 failures, 3 errors rake aborted! Command failed with status (1): [ruby -Ilib -w "c:/usr/ruby/lib/ruby/gems/1...] C:\usr\ruby\lib\ruby\gems\1.8\gems\rake-0.5.4.1> From lthiry at skynet.be Wed May 4 20:58:53 2005 From: lthiry at skynet.be (Lionel Thiry) Date: Wed May 4 20:49:39 2005 Subject: [Rake-devel] Test organization In-Reply-To: <28709.192.223.163.5.1115065770.squirrel@weirichhouse.org> References: <8FE83020B9E1A248A182A9B0A7B76E73015E6B7B@itomae2km07.AD.QINTRA.COM> <28709.192.223.163.5.1115065770.squirrel@weirichhouse.org> Message-ID: <42796FCD.2080904@skynet.be> Jim Weirich a ?crit : > Berger, Daniel said: >>3) Give me a test_all.rb that allows me to run all tests at once. Or is >>there something like that already? I didn't see it. > > > Handled by the Rakefile (see answer to #2). There is something I feel hard to understand. Is it consistent to test rake using rake? -- Lionel Thiry Personal website: http://users.skynet.be/lthiry/ From lthiry at skynet.be Wed May 4 22:14:48 2005 From: lthiry at skynet.be (Lionel Thiry) Date: Wed May 4 22:05:29 2005 Subject: [Rake-devel] the origin of the strange bug on win2k Message-ID: <42798198.809@skynet.be> Hello! By strange bug, I mean: ----8<---- -e:1:in `exit': no implicit conversion from nil to integer (TypeError) from -e:1 ----8<---- that appeared /while/ unittests of rake were running. I think it is because comspec (the win2k shell) doesn't substitute variables the same way as unix shell does. ----8<---- C:\usr\ruby\lib\ruby\gems\1.8\gems\rake-0.5.4.1>set RAKE_TEST_RUBY=123 C:\usr\ruby\lib\ruby\gems\1.8\gems\rake-0.5.4.1>echo $RAKE_TEST_RUBY $RAKE_TEST_RUBY C:\usr\ruby\lib\ruby\gems\1.8\gems\rake-0.5.4.1>echo %RAKE_TEST_RUBY% 123 C:\usr\ruby\lib\ruby\gems\1.8\gems\rake-0.5.4.1>ruby -e "exit $RAKE_TEST_RUBY" -e:1:in `exit': no implicit conversion from nil to integer (TypeError) from -e:1 C:\usr\ruby\lib\ruby\gems\1.8\gems\rake-0.5.4.1>ruby -e "puts %RAKE_TEST_RUBY%" 123 ----8<---- Concerning the tests, the problem lies in test/testfileutils.rb at line 99: ----8<---- ruby %{-e "exit $RAKE_TEST_RUBY"} do |ok, status| assert(!ok) assert_equal 123, status.exitstatus block_run = true end ----8<---- Unfortunatly, replacing $RAKE_TEST_RUBY with %RAKE_TEST_RUBY% doesn't work. I've conducted some tests to see what could work, see the attachment. ... But I don't find any solution yet. -- Lionel Thiry Personal website: http://users.skynet.be/lthiry/ -------------- next part -------------- ENV['RAKE_TEST_RUBY'] = "123" # prooves RAKE_TEST_RUBY is set for subshell puts %x{set}.split.include?("RAKE_TEST_RUBY=123") # prooves ENV is correctly set for sub-ruby puts %x{ruby -e "puts ENV['RAKE_TEST_RUBY']"} == "123\n" # prooves RAKE_TEST_RUBY is set for subshell in sub-ruby puts %x{ruby -e "puts %x{set}"}.split.include?("RAKE_TEST_RUBY=123") # this code perfectly works in a dos box: # > ruby -e "puts %RAKE_TEST_RUBY%" # 123 # but there is a conflict with ruby use of % puts %x{ruby -e "puts %RAKE_TEST_RUBY%"} # output: # -e:1: unknown type of %string # puts %RAKE_TEST_RUBY% # ^ # I don't find how to make this works From jim at weirichhouse.org Wed May 4 22:43:25 2005 From: jim at weirichhouse.org (Jim Weirich) Date: Wed May 4 22:35:32 2005 Subject: [Rake-devel] Test organization In-Reply-To: <42796FCD.2080904@skynet.be> References: <8FE83020B9E1A248A182A9B0A7B76E73015E6B7B@itomae2km07.AD.QINTRA.COM> <28709.192.223.163.5.1115065770.squirrel@weirichhouse.org> <42796FCD.2080904@skynet.be> Message-ID: <200505042243.25933.jim@weirichhouse.org> On Wednesday 04 May 2005 08:58 pm, Lionel Thiry wrote: > There is something I feel hard to understand. Is it consistent to test rake > using rake? Absolutely. The rake running the tests is (presumably) the installed and working stable version. The version being tested is loaded in a separate interpreter and the two versions of rake do not interfer with each other. -- -- Jim Weirich jim@weirichhouse.org http://onestepback.org ----------------------------------------------------------------- "Beware of bugs in the above code; I have only proved it correct, not tried it." -- Donald Knuth (in a memo to Peter van Emde Boas) From jim at weirichhouse.org Wed May 4 22:46:01 2005 From: jim at weirichhouse.org (Jim Weirich) Date: Wed May 4 22:38:05 2005 Subject: [Rake-devel] the origin of the strange bug on win2k In-Reply-To: <42798198.809@skynet.be> References: <42798198.809@skynet.be> Message-ID: <200505042246.01843.jim@weirichhouse.org> On Wednesday 04 May 2005 10:14 pm, Lionel Thiry wrote: > I think it is because comspec (the win2k shell) doesn't substitute > variables the same way as unix shell does. Thanks for tracking this down. I'm not sure yet what to do. I could disable the test on windows, but then it fails to test the feature it is designed to test. -- -- Jim Weirich jim@weirichhouse.org http://onestepback.org ----------------------------------------------------------------- "Beware of bugs in the above code; I have only proved it correct, not tried it." -- Donald Knuth (in a memo to Peter van Emde Boas) From djberge at qwest.com Thu May 5 16:49:58 2005 From: djberge at qwest.com (Daniel Berger) Date: Thu May 5 17:09:06 2005 Subject: [Rake-devel] Minor tweaks to 3 test files Message-ID: <427A86F6.1030701@qwest.com> Hi all, A couple of very minor diffs here: --- testfilelist.orig Thu May 5 14:36:57 2005 +++ testfilelist.rb Thu May 5 14:38:20 2005 @@ -12,6 +12,7 @@ def teardown FileList.select_default_ignore_patterns + FileUtils.rm_f("testdata") end def test_create --- testfileutils.orig Thu May 5 14:41:00 2005 +++ testfileutils.rb Thu May 5 14:40:25 2005 @@ -114,4 +114,7 @@ end end + def teardown + FileUtils.rm_f("testdata") + end end --- testtesttask.orig Thu May 5 14:47:02 2005 +++ testtesttask.rb Thu May 5 14:47:23 2005 @@ -68,4 +68,8 @@ assert_equal ['a.rb', 'b.rb', 'install.rb'], tt.file_list.to_a end + def teardown + FileUtils.rm_f("testdata") + end + end Tweaking these 3 seems to eliminate a leftover "testdata" directory after running "rake test". Unfortunately, it didn't eliminate the other errors I reported previously. Still working on those. :) Regards, Dan From djberge at qwest.com Thu May 5 17:01:37 2005 From: djberge at qwest.com (Daniel Berger) Date: Thu May 5 17:20:46 2005 Subject: [Rake-devel] Two errors solved, one to go Message-ID: <427A89B1.5080105@qwest.com> Hi all, I nailed two of the remaining issues I think: --- testfileutils.orig Thu May 5 14:41:00 2005 +++ testfileutils.rb Thu May 5 14:59:12 2005 @@ -8,6 +8,10 @@ class TestFileUtils < Test::Unit::TestCase include FileCreation + def setup + File.chmod(0750,"test/shellcommand.rb") + end + def test_rm_one_file create_file("testdata/a") FileUtils.rm_r "testdata/a" @@ -114,4 +118,7 @@ end end + def teardown + FileUtils.rm_f("testdata") + end end Note that the diff includes the teardown modification I posted in my last email. That leaves only this one: 3) Error: test_create(TestMakefileLoader): Errno::ENOENT: No such file or directory - test/data/sample.mf ./lib/rake/loaders/makefile.rb:11:in `initialize' ./lib/rake/loaders/makefile.rb:11:in `open' ./lib/rake/loaders/makefile.rb:11:in `load' ./test/test_makefile_loader.rb:11:in `test_create' There doesn't seem to actually be a test/data/sample.mf file anywhere. Unless I deleted it somehow, but I don't think so. Dan From lthiry at skynet.be Thu May 5 17:30:48 2005 From: lthiry at skynet.be (Lionel Thiry) Date: Thu May 5 17:21:36 2005 Subject: [Rake-devel] Test organization In-Reply-To: <200505042243.25933.jim@weirichhouse.org> References: <8FE83020B9E1A248A182A9B0A7B76E73015E6B7B@itomae2km07.AD.QINTRA.COM> <28709.192.223.163.5.1115065770.squirrel@weirichhouse.org> <42796FCD.2080904@skynet.be> <200505042243.25933.jim@weirichhouse.org> Message-ID: <427A9088.50107@skynet.be> Jim Weirich a ?crit : > On Wednesday 04 May 2005 08:58 pm, Lionel Thiry wrote: > >>There is something I feel hard to understand. Is it consistent to test rake >>using rake? > > > Absolutely. The rake running the tests is (presumably) the installed and > working stable version. The version being tested is loaded in a separate > interpreter and the two versions of rake do not interfer with each other. > I'm not sure I get it. You mean that when I do "rake" in gems/rake-0.5.4, it is then the 0.5.3 that is actually run, and 0.5.4 that is tested? Or am I still missing the point? -- Lionel Thiry Personal website: http://users.skynet.be/lthiry/ From lthiry at skynet.be Thu May 5 17:49:21 2005 From: lthiry at skynet.be (Lionel Thiry) Date: Thu May 5 17:40:09 2005 Subject: [Rake-devel] the origin of the strange bug on win2k In-Reply-To: <200505042246.01843.jim@weirichhouse.org> References: <42798198.809@skynet.be> <200505042246.01843.jim@weirichhouse.org> Message-ID: <427A94E1.9080803@skynet.be> Jim Weirich a ?crit : > On Wednesday 04 May 2005 10:14 pm, Lionel Thiry wrote: > >>I think it is because comspec (the win2k shell) doesn't substitute >>variables the same way as unix shell does. > > > Thanks for tracking this down. I'm not sure yet what to do. I could disable > the test on windows, but then it fails to test the feature it is designed to > test. > Well, I won't tell you what to do, but I can tell you how scons gets its job done (if i hasn't changed too much since last time I looked at its code). It never counts on the default shell to do the variable substitutions a) it does variable substitution in command string itself b) it explicitly uses the shell to launch commands (I'm not sure why) c) it escapes the command string depending on the shell used d) it then run the command I know well those mecanisms as I tried to use scons on my older win98 platform and had a bug that I tracked myself. If I correctly remember how it works, on win2k, the command string could look like this in ruby: "cmd #{cmd_escape("command string")}" It didn't work on win98 because escaping rules were different. And my bug report never been taken into account as win98 was not a supported platform. -- Lionel Thiry Personal website: http://users.skynet.be/lthiry/ From jim at weirichhouse.org Thu May 5 19:56:09 2005 From: jim at weirichhouse.org (Jim Weirich) Date: Thu May 5 19:49:25 2005 Subject: [Rake-devel] Two errors solved, one to go In-Reply-To: <427A89B1.5080105@qwest.com> References: <427A89B1.5080105@qwest.com> Message-ID: <200505051956.10070.jim@weirichhouse.org> On Thursday 05 May 2005 05:01 pm, Daniel Berger wrote: > I nailed two of the remaining issues I think: Patches applied. > There doesn't seem to actually be a test/data/sample.mf file anywhere. > Unless I deleted it somehow, but I don't think so. My bad. It is in CVS, so if you grabbed the CVS head it would be there. However, I neglected to include it in the gem. The latest beta gem (0.5.4.2) at http://onestepback.org/betagems should have all the patches and include sample.mf. -- -- Jim Weirich jim@weirichhouse.org http://onestepback.org ----------------------------------------------------------------- "Beware of bugs in the above code; I have only proved it correct, not tried it." -- Donald Knuth (in a memo to Peter van Emde Boas) From jim at weirichhouse.org Thu May 5 19:59:29 2005 From: jim at weirichhouse.org (Jim Weirich) Date: Thu May 5 19:52:43 2005 Subject: [Rake-devel] the origin of the strange bug on win2k In-Reply-To: <427A94E1.9080803@skynet.be> References: <42798198.809@skynet.be> <200505042246.01843.jim@weirichhouse.org> <427A94E1.9080803@skynet.be> Message-ID: <200505051959.29046.jim@weirichhouse.org> On Thursday 05 May 2005 05:49 pm, Lionel Thiry wrote: > It never counts on the default shell to do the variable substitutions > ? a) it does variable substitution in command string itself > ? b) it explicitly uses the shell to launch commands (I'm not sure why) > ? c) it escapes the command string depending on the shell used > ? d) it then run the command Hmmm ... I was hoping to avoid this. I suppose doing the variable substitution wouldn't be too bad. The only platform specific stuff would be the escaping, and I could avoid that by not using the shell. I'll consider this. Thanks for the feedback. -- -- Jim Weirich jim@weirichhouse.org http://onestepback.org ----------------------------------------------------------------- "Beware of bugs in the above code; I have only proved it correct, not tried it." -- Donald Knuth (in a memo to Peter van Emde Boas) From jim at weirichhouse.org Thu May 5 20:06:27 2005 From: jim at weirichhouse.org (Jim Weirich) Date: Thu May 5 19:59:42 2005 Subject: [Rake-devel] Test organization In-Reply-To: <427A9088.50107@skynet.be> References: <8FE83020B9E1A248A182A9B0A7B76E73015E6B7B@itomae2km07.AD.QINTRA.COM> <200505042243.25933.jim@weirichhouse.org> <427A9088.50107@skynet.be> Message-ID: <200505052006.27662.jim@weirichhouse.org> On Thursday 05 May 2005 05:30 pm, Lionel Thiry wrote: > You mean that when I do "rake" in gems/rake-0.5.4, it is then the 0.5.3 > that is actually run, and 0.5.4 that is tested? Or am I still missing the > point? Oh, I think I see your confusion. If you install a gem, then go to the gem's directory and run the tests, then yes, the version under test and the version running the test are the same (because you just installed that version). The key is to not install rake before you test it. Then you won't run into that problem. -- -- Jim Weirich jim@weirichhouse.org http://onestepback.org ----------------------------------------------------------------- "Beware of bugs in the above code; I have only proved it correct, not tried it." -- Donald Knuth (in a memo to Peter van Emde Boas) From lthiry at skynet.be Thu May 5 20:24:37 2005 From: lthiry at skynet.be (Lionel Thiry) Date: Thu May 5 20:15:18 2005 Subject: [Rake-devel] Test organization In-Reply-To: <200505052006.27662.jim@weirichhouse.org> References: <8FE83020B9E1A248A182A9B0A7B76E73015E6B7B@itomae2km07.AD.QINTRA.COM> <200505042243.25933.jim@weirichhouse.org> <427A9088.50107@skynet.be> <200505052006.27662.jim@weirichhouse.org> Message-ID: <427AB945.5090903@skynet.be> Jim Weirich a ?crit : > On Thursday 05 May 2005 05:30 pm, Lionel Thiry wrote: > >>You mean that when I do "rake" in gems/rake-0.5.4, it is then the 0.5.3 >>that is actually run, and 0.5.4 that is tested? Or am I still missing the >>point? > > > Oh, I think I see your confusion. If you install a gem, then go to the gem's > directory and run the tests, then yes, the version under test and the version > running the test are the same (because you just installed that version). > > The key is to not install rake before you test it. Then you won't run into > that problem. > Ok, I think I understand. You have your installed rake on one side, and your next-version not-yet-installed still-under-work rake (probably from CVS). But then how am I supposed to test the beta gems, and work on them, whithout installing them? Is there some gem command to just unpack the gem in my working directory? -- Lionel Thiry Personal website: http://users.skynet.be/lthiry/ From djberge at qwest.com Fri May 6 09:42:45 2005 From: djberge at qwest.com (Daniel Berger) Date: Fri May 6 10:01:53 2005 Subject: [Rake-devel] All tests pass on Solaris 10 Message-ID: <427B7455.8050007@qwest.com> >rake test (in /usr/local/lib/ruby/gems/1.8/gems/rake-0.5.4.2) mkdir -p testdata Loaded suite /usr/local/lib/ruby/gems/1.8/gems/rake-0.5.4.2/lib/rake/rake_test_loader Started .................................................................................................... Finished in 5.727355 seconds. 100 tests, 343 assertions, 0 failures, 0 errors Nice. :) Thanks much Jim! Dan From Daniel.Berger at qwest.com Fri May 6 10:51:37 2005 From: Daniel.Berger at qwest.com (Berger, Daniel) Date: Fri May 6 10:45:25 2005 Subject: [Rake-devel] test_each_dir_parent failure on Win32 Message-ID: <8FE83020B9E1A248A182A9B0A7B76E73015E6B90@itomae2km07.AD.QINTRA.COM> Hi all, This test failure appears to be separate from the shell issue: 5) Failure: test_each_dir_parent(TestRake) [./test/test_rake.rb:11]: <["c:/a/b", "c:/a", "c:"]> expected but was <["c:/a/b", "c:/a", "c:/"]>. I'm not familiar enough with "alldirs" to know whether the third element should be "c:" or "c:/". Thoughts? Regards, Dan From jim at weirichhouse.org Fri May 6 11:21:15 2005 From: jim at weirichhouse.org (Jim Weirich) Date: Fri May 6 11:15:00 2005 Subject: [Rake-devel] test_each_dir_parent failure on Win32 In-Reply-To: <8FE83020B9E1A248A182A9B0A7B76E73015E6B90@itomae2km07.AD.QINTRA.COM> References: <8FE83020B9E1A248A182A9B0A7B76E73015E6B90@itomae2km07.AD.QINTRA.COM> Message-ID: <11739.192.223.163.6.1115392875.squirrel@weirichhouse.org> Berger, Daniel said: > Hi all, > > This test failure appears to be separate from the shell issue: > > 5) Failure: > test_each_dir_parent(TestRake) [./test/test_rake.rb:11]: > <["c:/a/b", "c:/a", "c:"]> expected but was > <["c:/a/b", "c:/a", "c:/"]>. > > I'm not familiar enough with "alldirs" to know whether the third element > should be "c:" or "c:/". Thoughts? This seems to be system dependent behavior. On Linux, "c:" is probably the right answer because it is not treating "c:" differently than any other set of characters. On windows, "c:/" is probably the better answer. We can address this in the test case by allowing either option for test success (or make a system dependent test). Either way, I'm satisfied with this. -- -- Jim Weirich jim@weirichhouse.org http://onestepback.org ----------------------------------------------------------------- "Beware of bugs in the above code; I have only proved it correct, not tried it." -- Donald Knuth (in a memo to Peter van Emde Boas) From lthiry at skynet.be Fri May 6 11:51:16 2005 From: lthiry at skynet.be (Lionel Thiry) Date: Fri May 6 11:41:58 2005 Subject: [Rake-devel] test_each_dir_parent failure on Win32 In-Reply-To: <8FE83020B9E1A248A182A9B0A7B76E73015E6B90@itomae2km07.AD.QINTRA.COM> References: <8FE83020B9E1A248A182A9B0A7B76E73015E6B90@itomae2km07.AD.QINTRA.COM> Message-ID: <427B9274.4060008@skynet.be> Berger, Daniel a ?crit : > Hi all, > > This test failure appears to be separate from the shell issue: > > 5) Failure: > test_each_dir_parent(TestRake) [./test/test_rake.rb:11]: > <["c:/a/b", "c:/a", "c:"]> expected but was > <["c:/a/b", "c:/a", "c:/"]>. > > I'm not familiar enough with "alldirs" to know whether the third element > should be "c:" or "c:/". Thoughts? > > Regards, > > Dan Here are some differences in a dos box ----8<---- C:\usr\ruby\lib\ruby\gems\1.8\gems\rake-0.5.4.2>cd c: C:\usr\ruby\lib\ruby\gems\1.8\gems\rake-0.5.4.2 C:\usr\ruby\lib\ruby\gems\1.8\gems\rake-0.5.4.2>cd c:/ C:\usr\ruby\lib\ruby\gems\1.8\gems\rake-0.5.4.2 C:\usr\ruby\lib\ruby\gems\1.8\gems\rake-0.5.4.2>cd c:\ C:\>cd usr/ruby/lib/ruby/gems/1.8/gems/rake-0.5.4.2 C:\usr>cd ruby\lib\ruby\gems\1.8\gems\rake-0.5.4.2 C:\usr\ruby\lib\ruby\gems\1.8\gems\rake-0.5.4.2> ----8<---- As you can see, it behaves strangely if I use "/" instead of "\". I remember scons has to make some string manipulation with drive letter when working on windows, because of the inconsistent behavior of windows. -- Lionel Thiry Personal website: http://users.skynet.be/lthiry/ From lthiry at skynet.be Fri May 6 11:54:43 2005 From: lthiry at skynet.be (Lionel Thiry) Date: Fri May 6 11:45:25 2005 Subject: [Rake-devel] All tests pass on Solaris 10 In-Reply-To: <427B7455.8050007@qwest.com> References: <427B7455.8050007@qwest.com> Message-ID: <427B9343.8050702@skynet.be> Daniel Berger a ?crit : > >rake test > (in /usr/local/lib/ruby/gems/1.8/gems/rake-0.5.4.2) > mkdir -p testdata > Loaded suite > /usr/local/lib/ruby/gems/1.8/gems/rake-0.5.4.2/lib/rake/rake_test_loader > Started > .................................................................................................... > > Finished in 5.727355 seconds. > > 100 tests, 343 assertions, 0 failures, 0 errors > > Nice. :) > > Thanks much Jim! > > Dan Here is mine, on win2k: ----8<---- C:\usr\ruby\lib\ruby\gems\1.8\gems\rake-0.5.4.2>rake (in C:/usr/ruby/lib/ruby/gems/1.8/gems/rake-0.5.4.2) mkdir -p testdata ruby -Ilib -w "c:/usr/ruby/lib/ruby/gems/1.8/gems/rake-0.5.4.2/lib/rake/rake_tes t_loader.rb" "test/test_clean.rb" "test/test_filelist.rb" "test/test_fileutils.r b" "test/test_ftp.rb" "test/test_makefile_loader.rb" "test/test_package_task.rb" "test/test_rake.rb" "test/test_tasks.rb" "test/test_test_task.rb" "test/contrib /testsys.rb" "test/functional.rb" UNABLE TO RUN FUNCTIONAL TESTS No Session Found Loaded suite c:/usr/ruby/lib/ruby/gems/1.8/gems/rake-0.5.4.2/lib/rake/rake_test_ loader Started ........................................................-e:1:in `exit': no impli cit conversion from nil to integer (TypeError) from -e:1 FE.EF............F........................... Finished in 4.328 seconds. 1) Failure: test_ruby(TestFileUtils) [./test/test_fileutils.rb:109:in `test_ruby' ./test/test_fileutils.rb:107:in `call' ./lib/rake.rb:491:in `sh' ./lib/rake.rb:562:in `sh' ./lib/rake.rb:557:in `sh' ./lib/rake.rb:509:in `ruby' ./lib/rake.rb:562:in `ruby' ./lib/rake.rb:557:in `ruby' ./test/test_fileutils.rb:107:in `test_ruby' ./test/test_fileutils.rb:103:in `verbose' ./test/test_fileutils.rb:103:in `test_ruby']: <123> expected but was <1>. 2) Error: test_sh(TestFileUtils): RuntimeError: Command failed with status (1): [test/shellcommand.rb] ./lib/rake.rb:484:in `sh' ./lib/rake.rb:483:in `call' ./lib/rake.rb:491:in `sh' ./lib/rake.rb:562:in `sh' ./lib/rake.rb:557:in `sh' ./test/test_fileutils.rb:64:in `test_sh' ./test/test_fileutils.rb:64:in `verbose' ./test/test_fileutils.rb:64:in `test_sh' 3) Error: test_sh_multiple_arguments(TestFileUtils): RuntimeError: Command failed with status (1): [test $RAKE_TEST_SH = someval] ./lib/rake.rb:484:in `sh' ./lib/rake.rb:483:in `call' ./lib/rake.rb:491:in `sh' ./lib/rake.rb:562:in `sh' ./lib/rake.rb:557:in `sh' ./test/test_fileutils.rb:71:in `test_sh_multiple_arguments' ./test/test_fileutils.rb:71:in `verbose' ./test/test_fileutils.rb:71:in `test_sh_multiple_arguments' 4) Failure: test_sh_special_handling(TestFileUtils) [./test/test_fileutils.rb:89:in `test_sh_special_handling' ./test/test_fileutils.rb:88:in `call' ./lib/rake.rb:491:in `sh' ./lib/rake.rb:562:in `sh' ./lib/rake.rb:557:in `sh' ./test/test_fileutils.rb:88:in `test_sh_special_handling' ./test/test_fileutils.rb:87:in `verbose' ./test/test_fileutils.rb:87:in `test_sh_special_handling']: is not true. 5) Failure: test_each_dir_parent(TestRake) [./test/test_rake.rb:11]: <["c:/a/b", "c:/a", "c:"]> expected but was <["c:/a/b", "c:/a", "c:/"]>. 101 tests, 337 assertions, 3 failures, 2 errors rake aborted! Command failed with status (1): [ruby -Ilib -w "c:/usr/ruby/lib/ruby/gems/1...] C:\usr\ruby\lib\ruby\gems\1.8\gems\rake-0.5.4.2> ----8<---- Still work to do, keep courage! :) -- Lionel Thiry Personal website: http://users.skynet.be/lthiry/ From djberge at qwest.com Fri May 6 14:16:47 2005 From: djberge at qwest.com (Daniel Berger) Date: Fri May 6 14:35:54 2005 Subject: [Rake-devel] All tests pass on Solaris 10 In-Reply-To: <427B9343.8050702@skynet.be> References: <427B7455.8050007@qwest.com> <427B9343.8050702@skynet.be> Message-ID: <427BB48F.6050407@qwest.com> Lionel Thiry wrote: > Daniel Berger a ?crit : > Here is mine, on win2k: Yeah, well, we know. ;) I just wanted folks to know it works on *nix. We'll get the Win32 issues worked out yet, and then all will be well. I think I'd really like to see rake included as part of the stdlib in 1.8.3 and beyond, so I see getting proper Win32 support as imperative. Regards, Dan From djberge at qwest.com Mon May 9 16:52:37 2005 From: djberge at qwest.com (Daniel Berger) Date: Mon May 9 17:11:52 2005 Subject: [Rake-devel] test_each_dir_parent failure on Win32 In-Reply-To: <11739.192.223.163.6.1115392875.squirrel@weirichhouse.org> References: <8FE83020B9E1A248A182A9B0A7B76E73015E6B90@itomae2km07.AD.QINTRA. COM> <11739.192.223.163.6.1115392875.squirrel@weirichhouse.org> Message-ID: <427FCD95.9020304@qwest.com> Jim Weirich wrote: > Berger, Daniel said: > >>Hi all, >> >>This test failure appears to be separate from the shell issue: >> >>5) Failure: >>test_each_dir_parent(TestRake) [./test/test_rake.rb:11]: >><["c:/a/b", "c:/a", "c:"]> expected but was >><["c:/a/b", "c:/a", "c:/"]>. >> >>I'm not familiar enough with "alldirs" to know whether the third element >>should be "c:" or "c:/". Thoughts? > > > This seems to be system dependent behavior. On Linux, "c:" is probably > the right answer because it is not treating "c:" differently than any > other set of characters. On windows, "c:/" is probably the better answer. > > We can address this in the test case by allowing either option for test > success (or make a system dependent test). Either way, I'm satisfied with > this. How's this? --- test_rake.orig Mon May 9 14:47:37 2005 +++ test_rake.rb Mon May 9 14:49:10 2005 @@ -4,11 +4,16 @@ require 'rake' class TestRake < Test::Unit::TestCase + def setup + @root = 'c:' + @root = 'c:/' if File::ALT_SEPARATOR + end + def test_each_dir_parent assert_equal ['a'], alldirs('a') assert_equal ['a/b', 'a'], alldirs('a/b') assert_equal ['/a/b', '/a', '/'], alldirs('/a/b') - assert_equal ['c:/a/b', 'c:/a', 'c:'], alldirs('c:/a/b') + assert_equal ['c:/a/b', 'c:/a', @root], alldirs('c:/a/b') assert_equal ['c:a/b', 'c:a'], alldirs('c:a/b') end Regards, Dan From tilman at code-monkey.de Mon May 23 14:16:19 2005 From: tilman at code-monkey.de (Tilman Sauerbeck) Date: Mon May 23 14:09:05 2005 Subject: [Rake-devel] Rake Configuretask Message-ID: <20050523181619.GA7451@code-monkey.de> Hi guys, I started work on a configuretask recently, which is to provide the functionality of autoconf/mkmf, somewhat. So far there is very little functionality, but before implementing more tests etc I'd like to get some input from other Rake users. What do you think about the API in general, any other ideas on the design? :) Regards, Tilman -- learn to quote: http://www.netmeister.org/news/learn2quote.html -------------- next part -------------- require "rake/tasklib" require "rake/clean" require "yaml" require "tempfile" module Rake class ConfigureTask < TaskLib CACHE_FILE = ".configure_state.yaml" attr_reader :tests def initialize # :yield: self @tests = TestList.new(load_tests || []) yield self if block_given? define end # returns the test with the specified name def [](name) @tests.find { |t| t.name == name } end def method_missing(m) self[m.to_s] end private def load_tests r = nil if File.exist?(CACHE_FILE) File.open(CACHE_FILE, "r") { |f| r = YAML.load(f) } end r.is_a?(TestList) ? r : nil end def define desc "Remove configure results" task :clobber_configure do FileUtils::Verbose.rm_f(CACHE_FILE) end task :clobber => :clobber_configure desc "Configure this package" task :configure => [CACHE_FILE] file CACHE_FILE do @tests.each do |t| t.on_checking.reverse.each { |b| b.call } if t.invoke t.on_success.reverse.each { |b| b.call } else t.on_failure.reverse.each { |b| b.call } end end # store the test results in CACHE_FILE File.open(CACHE_FILE, "w") { |f| YAML.dump(@tests, f) } end end class TestList < Array # stored_tests needs to be optional because of a bug in # Ruby 1.8's YAML implementation. def initialize(stored_tests = []) @stored_tests = stored_tests end def <<(arg) assign_result(arg) super end def push(*args) args.each { |a| assign_result(a) } super end def unshift(arg) assign_result(arg) super end private def assign_result(test) st = @stored_tests.find { |st| st.name == test.name } test.result = st.result unless st.nil? end end class Test attr_reader :name, :on_checking, :on_success, :on_failure attr_accessor :result def initialize(name, opts = {}) # :yield: self @name = name.to_str.strip.dup @result = nil @on_checking = [] @on_success = [] @on_failure = [] if opts[:is_critical] @on_failure << lambda { raise } end yield self if block_given? end def to_yaml_properties ["@name", "@result"] end def invoke end protected def can_exec_binary?(bin) fork do tf = Tempfile.open("configuretask") STDOUT.reopen(tf) STDERR.reopen(tf) begin exec(bin) rescue SystemCallError exit 0xb00bface end end Process.wait $?.exitstatus != 0xb00bface end end class FooConfigTest < Test def initialize(name, opts = {}) super @result = {} @command = "#{name}-config" @on_checking << lambda { print "Checking for #{name}... " } @on_success << lambda { puts "yes (#{version})" } @on_failure << lambda { puts "no" } end def method_missing(m) @result[m] end def invoke return false unless can_exec_command? [:version, :cflags, :libs].each do |f| @result[f] = lookup_flags(f) end true end protected def lookup_flags(f) tmp = `#{@command} --#{f}`.strip $?.exitstatus.zero? ? tmp : nil end private def can_exec_command? can_exec_binary?(@command) end end class PkgConfigTest < FooConfigTest def initialize(name, opts = {}) super @command = "pkg-config --silence-errors" end protected def lookup_flags(f) f = :modversion if f == :version tmp = `#{@command} --#{f} #{@name}`.strip $?.exitstatus.zero? ? tmp : nil end end end end