facets 2.2.1 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGES +6 -0
- data/NOTES +14 -1
- data/Rakefile +26 -0
- data/demo/bench/general/bench_calls.rb +74 -0
- data/demo/bench/general/bench_includes.rb +25 -0
- data/demo/bench/general/bench_methods.rb +17 -0
- data/demo/bench/general/bench_pathname.rb +24 -0
- data/demo/bench/general/bench_range.rb +64 -0
- data/demo/bench/general/bench_return.rb +56 -0
- data/demo/bench/general/bench_yeild.rb +75 -0
- data/lib/{more → class}/facets/association.rb +0 -0
- data/lib/{more → class}/facets/autoarray.rb +0 -0
- data/lib/{more → class}/facets/basicobject.rb +0 -0
- data/lib/{more → class}/facets/buildingblock.rb +0 -44
- data/lib/{more → class}/facets/cachedelegator.rb +3 -0
- data/lib/{more → class}/facets/coroutine.rb +0 -56
- data/lib/{more → class}/facets/dictionary.rb +0 -0
- data/lib/{more → class}/facets/downloader.rb +0 -0
- data/lib/{more → class}/facets/filelist.rb +0 -0
- data/lib/{more → class}/facets/fileshell.rb +0 -0
- data/lib/{more → class}/facets/hashbuilder.rb +0 -0
- data/lib/{more → class}/facets/heap.rb +0 -0
- data/lib/{more → class}/facets/infinity.rb +0 -46
- data/lib/{more → class}/facets/interval.rb +0 -0
- data/lib/{more → class}/facets/ioredirect.rb +0 -0
- data/lib/{more → class}/facets/linkedlist.rb +0 -42
- data/lib/{more → class}/facets/lrucache.rb +0 -23
- data/lib/{more → class}/facets/minitar.rb +0 -0
- data/lib/{more → class}/facets/nackclass.rb +0 -0
- data/lib/{more → class}/facets/nullclass.rb +0 -0
- data/lib/{more → class}/facets/opencascade.rb +0 -70
- data/lib/{more → class}/facets/opencollection.rb +0 -0
- data/lib/class/facets/openhash.rb +41 -0
- data/lib/{more → class}/facets/openobject.rb +0 -121
- data/lib/{more → class}/facets/orderedhash.rb +0 -0
- data/lib/{more → class}/facets/pathlist.rb +0 -0
- data/lib/{more → class}/facets/pool.rb +0 -0
- data/lib/{more → class}/facets/pqueue.rb +0 -0
- data/lib/{more → class}/facets/progressbar.rb +0 -0
- data/lib/{more → class}/facets/recorder.rb +0 -40
- data/lib/{more → class}/facets/reference.rb +0 -0
- data/lib/{more → class}/facets/rwdelegator.rb +0 -0
- data/lib/{more → class}/facets/semaphore.rb +0 -0
- data/lib/{more → class}/facets/syncarray.rb +0 -24
- data/lib/{more → class}/facets/synchash.rb +1 -25
- data/lib/{more → class}/facets/timer.rb +0 -62
- data/lib/{more → class}/facets/tuple.rb +0 -60
- data/lib/{more → class}/facets/version.rb +0 -0
- data/lib/core/facets/dir/multiglob.rb +20 -5
- data/lib/core/facets/enumerable/cartesian.rb +2 -2
- data/lib/core/facets/enumerable/combination.rb +9 -1
- data/lib/core/facets/kernel/object.rb +1 -1
- data/lib/{more → mixin}/facets/binreadable.rb +0 -62
- data/lib/{more → mixin}/facets/buildable.rb +0 -48
- data/lib/mixin/facets/cloneable.rb +90 -0
- data/lib/{more → mixin}/facets/enumerablepass.rb +0 -81
- data/lib/{more → mixin}/facets/expirable.rb +0 -0
- data/lib/{more → mixin}/facets/fileable.rb +0 -0
- data/lib/{more → mixin}/facets/instantiable.rb +0 -30
- data/lib/{more → mixin}/facets/multiton.rb +0 -0
- data/lib/{more → mixin}/facets/registerable.rb +0 -0
- data/lib/mixin/facets/tasksystem.rb +350 -0
- data/lib/{more → mixin}/facets/uninheritable.rb +1 -39
- data/lib/{more → mixin}/facets/validation.rb +0 -0
- data/lib/more/facets/arguments.rb +0 -66
- data/lib/more/facets/attributes.rb +0 -35
- data/lib/more/facets/bbcode.rb +1 -31
- data/lib/more/facets/bytes.rb +0 -80
- data/lib/more/facets/class_extension.rb +0 -66
- data/lib/more/facets/classmethods.rb +0 -64
- data/lib/more/facets/compare_on.rb +0 -52
- data/lib/more/facets/curry.rb +0 -29
- data/lib/more/facets/cut.rb +0 -27
- data/lib/more/facets/date.rb +0 -54
- data/lib/more/facets/dependency.rb +0 -70
- data/lib/more/facets/elementor.rb +0 -67
- data/lib/more/facets/getoptlong.rb +0 -30
- data/lib/more/facets/{hash_keyize.rb → hash/keyize.rb} +0 -0
- data/lib/more/facets/inheritor.rb +0 -150
- data/lib/more/facets/instantise.rb +0 -41
- data/lib/more/facets/let.rb +0 -20
- data/lib/more/facets/memoize.rb +0 -45
- data/lib/more/facets/multipliers.rb +0 -110
- data/lib/more/facets/ostruct.rb +0 -124
- data/lib/more/facets/random.rb +0 -153
- data/lib/more/facets/rbconfig.rb +55 -0
- data/lib/more/facets/set.rb +27 -0
- data/lib/more/facets/snapshot.rb +0 -30
- data/lib/more/facets/stylize.rb +0 -147
- data/lib/more/facets/times.rb +0 -98
- data/lib/more/facets/tracepoint.rb +194 -0
- data/lib/more/facets/typecast.rb +0 -63
- data/lib/more/facets/ziputils.rb +7 -0
- data/log/Changelog-0.txt +239 -0
- data/log/Changelog-1.txt +450 -0
- data/log/Changelog.txt +841 -0
- data/log/Fixme.txt +18 -0
- data/log/Testlog.txt +188 -0
- data/log/Todo.txt +326 -0
- data/meta/MANIFEST +1 -1
- data/meta/VERSION +1 -0
- data/meta/authors +48 -0
- data/meta/description +8 -0
- data/meta/project.yaml +11 -5
- data/task/install +4 -2
- data/task/rdoc +5 -0
- data/task/test +40 -0
- data/test/{unit → class}/test_association.rb +0 -0
- data/test/{unit → class}/test_autoarray.rb +0 -0
- data/test/{unit → class}/test_basicobject.rb +0 -0
- data/test/{unit → class}/test_buildingblock.rb +1 -0
- data/test/{unit → class}/test_coroutine.rb +0 -0
- data/test/{unit → class}/test_dictionary.rb +0 -0
- data/test/{unit → class}/test_infinity.rb +0 -0
- data/test/{unit → class}/test_interval.rb +0 -0
- data/test/{unit → class}/test_linkedlist.rb +1 -1
- data/test/{unit → class}/test_lrucache.rb +3 -0
- data/test/{unit → class}/test_opencascade.rb +0 -0
- data/test/{unit → class}/test_openobject.rb +0 -0
- data/test/{unit → class}/test_recorder.rb +0 -1
- data/test/{unit → class}/test_syncarray.rb +2 -4
- data/test/{unit → class}/test_synchash.rb +2 -4
- data/test/{unit → class}/test_timer.rb +0 -1
- data/test/{unit → class}/test_tuple.rb +0 -0
- data/test/{unit → core}/array/test_delete.rb +0 -0
- data/test/{unit → core}/array/test_indexable.rb +0 -0
- data/test/{unit → core}/array/test_merge.rb +0 -0
- data/test/{unit → core}/array/test_only.rb +0 -0
- data/test/{unit → core}/array/test_pad.rb +0 -0
- data/test/{unit → core}/array/test_rotate.rb +0 -0
- data/test/{unit → core}/array/test_select.rb +0 -0
- data/test/{unit → core}/array/test_stackable.rb +0 -0
- data/test/{unit/binding/test_cflow.rb → core/binding/test_caller.rb} +2 -2
- data/test/{unit → core}/binding/test_defined.rb +0 -0
- data/test/{unit → core}/binding/test_eval.rb +0 -0
- data/test/{unit → core}/binding/test_here.rb +0 -0
- data/test/{unit → core}/binding/test_self.rb +0 -0
- data/test/{unit → core}/binding/test_vars.rb +0 -0
- data/test/{unit → core}/class/test_descendents.rb +0 -0
- data/test/{unit → core}/class/test_initializer.rb +0 -0
- data/test/{unit → core}/class/test_remove_descendents.rb +0 -0
- data/test/{unit → core}/comparable/test_bound.rb +0 -0
- data/test/{unit → core}/comparable/test_cmp.rb +0 -0
- data/test/{unit → core}/dir/test_parent.rb +0 -0
- data/test/{unit → core}/dir/test_recurse.rb +0 -0
- data/test/{unit → core}/dir/test_traverse.rb +0 -0
- data/test/{unit → core}/enumerable/test_cartesian.rb +0 -0
- data/test/{unit → core}/enumerable/test_collect.rb +0 -0
- data/test/{unit → core}/enumerable/test_combination.rb +0 -0
- data/test/{unit → core}/enumerable/test_count.rb +0 -0
- data/test/{unit → core}/enumerable/test_each.rb +0 -0
- data/test/{unit → core}/enumerable/test_mash.rb +0 -0
- data/test/{unit → core}/enumerable/test_permutation.rb +0 -0
- data/test/{unit → core}/enumerable/test_probability.rb +0 -0
- data/test/{unit → core}/enumerable/test_split.rb +0 -0
- data/test/{unit → core}/exception/test_detail.rb +0 -0
- data/test/{unit → core}/file/test_null.rb +0 -0
- data/test/{unit → core}/file/test_read.rb +0 -0
- data/test/{unit → core}/file/test_sanitize.rb +0 -0
- data/test/{unit → core}/file/test_split_all.rb +0 -0
- data/test/{unit → core}/file/test_write.rb +0 -0
- data/test/{unit → core}/filetest/test_root.rb +0 -0
- data/test/{unit → core}/hash/test_alias.rb +0 -0
- data/test/{unit → core}/hash/test_at.rb +0 -0
- data/test/{unit → core}/hash/test_autonew.rb +0 -0
- data/test/core/hash/test_collate.rb +33 -0
- data/test/{unit → core}/hash/test_delete.rb +0 -0
- data/test/{unit → core}/hash/test_each_with_key.rb +0 -0
- data/test/{unit → core}/hash/test_has_keys.rb +0 -0
- data/test/{unit → core}/hash/test_insert.rb +0 -0
- data/test/{unit → core}/hash/test_inverse.rb +0 -0
- data/test/{unit → core}/hash/test_op.rb +0 -0
- data/test/{unit → core}/hash/test_rekey.rb +0 -0
- data/test/{unit → core}/hash/test_reverse_merge.rb +0 -0
- data/test/{unit → core}/hash/test_select.rb +0 -0
- data/test/{unit → core}/hash/test_swap.rb +0 -0
- data/test/{unit → core}/hash/test_traverse.rb +0 -0
- data/test/{unit → core}/hash/test_update.rb +0 -0
- data/test/{unit → core}/hash/test_weave.rb +0 -0
- data/test/{unit → core}/hash/test_zipnew.rb +0 -0
- data/test/{unit → core}/integer/test_bitmask.rb +0 -0
- data/test/{unit → core}/integer/test_factorial.rb +0 -0
- data/test/{unit → core}/integer/test_multiple.rb +0 -0
- data/test/{unit → core}/integer/test_of.rb +0 -0
- data/test/{unit → core}/kernel/test_callstack.rb +0 -0
- data/test/{unit → core}/kernel/test_constant.rb +0 -0
- data/test/{unit → core}/kernel/test_deepcopy.rb +0 -0
- data/test/{unit → core}/kernel/test_instance.rb +0 -0
- data/test/{unit → core}/kernel/test_metaid.rb +0 -0
- data/test/{unit → core}/kernel/test_object.rb +1 -1
- data/test/{unit → core}/kernel/test_populate.rb +0 -0
- data/test/{unit → core}/kernel/test_report.rb +0 -0
- data/test/{unit → core}/kernel/test_returning.rb +0 -0
- data/test/{unit → core}/kernel/test_silence.rb +0 -0
- data/test/{unit → core}/kernel/test_super.rb +0 -0
- data/test/{unit → core}/kernel/test_tap.rb +0 -0
- data/test/{unit → core}/kernel/test_val.rb +0 -0
- data/test/{unit → core}/kernel/test_withattr.rb +0 -0
- data/test/{unit → core}/matchdata/test_match.rb +0 -0
- data/test/{unit → core}/matchdata/test_matchset.rb +0 -0
- data/test/{unit → core}/module/test_abstract.rb +0 -0
- data/test/{unit → core}/module/test_alias.rb +0 -0
- data/test/{unit → core}/module/test_cattr.rb +0 -0
- data/test/{unit → core}/module/test_clone.rb +0 -0
- data/test/{unit → core}/module/test_include.rb +0 -0
- data/test/{unit → core}/module/test_modify.rb +0 -0
- data/test/{unit → core}/module/test_name.rb +0 -0
- data/test/{unit → core}/module/test_traits.rb +0 -0
- data/test/{unit → core}/numeric/test_round.rb +0 -0
- data/test/{unit → core}/proc/test_bind.rb +0 -0
- data/test/{unit → core}/proc/test_compose.rb +0 -0
- data/test/{unit → core}/range/test_combine.rb +0 -0
- data/test/{unit → core}/range/test_overlap.rb +0 -0
- data/test/{unit → core}/regexp/test_arity.rb +0 -0
- data/test/{unit → core}/string/test_align.rb +0 -0
- data/test/{unit → core}/string/test_blank.rb +0 -0
- data/test/{unit → core}/string/test_bracket.rb +0 -0
- data/test/{unit → core}/string/test_case.rb +0 -0
- data/test/{unit → core}/string/test_crypt.rb +0 -0
- data/test/{unit → core}/string/test_filter.rb +0 -0
- data/test/{unit → core}/string/test_indexable.rb +0 -0
- data/test/{unit → core}/string/test_interpolate.rb +0 -0
- data/test/{unit → core}/string/test_natcmp.rb +0 -0
- data/test/{unit → core}/string/test_nchar.rb +0 -0
- data/test/{unit → core}/string/test_op.rb +0 -0
- data/test/{unit → core}/string/test_partitions.rb +0 -0
- data/test/{unit → core}/string/test_range.rb +0 -0
- data/test/{unit → core}/string/test_regesc.rb +0 -0
- data/test/{unit → core}/string/test_scan.rb +0 -0
- data/test/{unit → core}/string/test_stackable.rb +0 -0
- data/test/{unit → core}/string/test_tabs.rb +0 -0
- data/test/{unit → core}/string/test_wrap.rb +0 -0
- data/test/{unit → core}/symbol/test_chomp.rb +0 -0
- data/test/{unit → core}/symbol/test_generate.rb +0 -0
- data/test/{unit → core}/symbol/test_not.rb +0 -0
- data/test/{unit → core}/symbol/test_shadow.rb +0 -0
- data/test/{unit → core}/symbol/test_succ.rb +0 -0
- data/test/{unit → core}/symbol/test_to_proc.rb +0 -0
- data/test/{unit → core}/test_1stclassmethod.rb +0 -0
- data/test/{unit → core}/test_boolean.rb +0 -0
- data/test/{unit → core}/test_conversion.rb +0 -0
- data/test/{unit → core}/test_functor.rb +0 -0
- data/test/{unit → core}/time/test_change.rb +0 -0
- data/test/{unit → core}/time/test_elapse.rb +0 -0
- data/test/{unit → core}/time/test_stamp.rb +0 -0
- data/test/{unit → mixin}/test_binreadable.rb +0 -0
- data/test/{unit → mixin}/test_buildable.rb +1 -0
- data/test/mixin/test_cloneable.rb +41 -0
- data/test/{unit → mixin}/test_enumerablepass.rb +0 -0
- data/test/{unit → mixin}/test_instantiable.rb +2 -1
- data/test/{unit → mixin}/test_multiton.rb +0 -0
- data/test/{unit → mixin}/test_uninheritable.rb +1 -2
- data/test/{unit → more/hash}/test_keyize.rb +1 -1
- data/test/{unit → more}/test_advice.rb +0 -0
- data/test/{unit → more}/test_annotations.rb +0 -0
- data/test/{unit → more}/test_ansicode.rb +0 -0
- data/test/{unit → more}/test_aop.rb +0 -0
- data/test/{unit → more}/test_arguments.rb +1 -0
- data/test/{unit → more}/test_attributes.rb +2 -2
- data/test/{unit → more}/test_bbcode.rb +1 -0
- data/test/{unit → more}/test_bytes.rb +1 -0
- data/test/{unit → more}/test_class_extension.rb +2 -1
- data/test/{unit → more}/test_classmethods.rb +2 -1
- data/test/{unit → more}/test_compare_on.rb +0 -1
- data/test/{unit → more}/test_continuation.rb +0 -0
- data/test/{unit → more}/test_crypt.rb +0 -0
- data/test/{unit → more}/test_curry.rb +1 -0
- data/test/{unit → more}/test_cut.rb +2 -1
- data/test/{unit → more}/test_date.rb +1 -1
- data/test/{unit → more}/test_dependency.rb +2 -2
- data/test/{unit → more}/test_elementor.rb +1 -1
- data/test/{unit → more}/test_getoptlong.rb +1 -0
- data/test/{unit → more}/test_inheritor.rb +1 -1
- data/test/{unit → more}/test_instantise.rb +2 -1
- data/test/{unit → more}/test_interface.rb +0 -0
- data/test/{unit → more}/test_let.rb +0 -1
- data/test/{unit → more}/test_memoize.rb +2 -3
- data/test/{unit → more}/test_multipliers.rb +1 -1
- data/test/{unit → more}/test_namespace.rb +0 -0
- data/test/{unit → more}/test_ostruct.rb +0 -0
- data/test/{unit → more}/test_overload.rb +0 -0
- data/test/{unit → more}/test_paramix.rb +0 -0
- data/test/{unit → more}/test_prototype.rb +0 -0
- data/test/more/test_random.rb +146 -0
- data/test/{unit → more}/test_snapshot.rb +0 -3
- data/test/{unit → more}/test_stylize.rb +1 -2
- data/test/{unit → more}/test_thread.rb +0 -0
- data/test/{unit → more}/test_times.rb +2 -2
- data/test/{unit → more}/test_typecast.rb +0 -3
- metadata +1117 -1098
- data/lib/more/facets/cloneable.rb +0 -75
- data/log/changelog.txt +0 -0
- data/meta/facets.roll +0 -4
- data/meta/google_ad.html +0 -15
- data/meta/icli.yaml +0 -17
- data/task/changes +0 -29
- data/task/clean +0 -17
- data/task/clobber/package +0 -10
- data/task/log +0 -17
- data/task/prepare +0 -7
- data/task/publish +0 -43
- data/task/release +0 -10
- data/task/stamp +0 -33
- data/task/stats +0 -138
- data/task/test/cross +0 -309
- data/task/test/each +0 -42
- data/task/test/load +0 -30
- data/task/test/pairs +0 -50
- data/task/test/solo +0 -294
- data/task/test/syntax +0 -31
- data/task/test/whole +0 -34
- data/test/unit/hash/test_collate.rb +0 -31
- data/test/unit/test_random.rb +0 -149
data/task/test/each
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env ratch
|
|
2
|
-
|
|
3
|
-
# cross-run unit tests
|
|
4
|
-
#
|
|
5
|
-
# This tool runs all tests against each other in pairs
|
|
6
|
-
# to ensure across the board compatibility.
|
|
7
|
-
|
|
8
|
-
require "./lib/more/facets/progressbar"
|
|
9
|
-
|
|
10
|
-
main :test do
|
|
11
|
-
output = 'doc/log/isotest.txt'
|
|
12
|
-
|
|
13
|
-
live = ARGV.delete('--live')
|
|
14
|
-
|
|
15
|
-
find = 'test/**/test_*.rb'
|
|
16
|
-
|
|
17
|
-
tests = Dir.glob(find).reject{ |f| dir?(f) }
|
|
18
|
-
tests = tests.sort{ |a,b| File.basename(a) <=> File.basename(b) }
|
|
19
|
-
|
|
20
|
-
File.open(output, 'w'){ |f|
|
|
21
|
-
f << "= ISO TESTING\n\n==#{Time.now}\n\n"
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
total = tests.size
|
|
25
|
-
|
|
26
|
-
pbar = Console::ProgressBar.new("IsoTest", total+1)
|
|
27
|
-
pbar.inc
|
|
28
|
-
|
|
29
|
-
tests.each do |file|
|
|
30
|
-
pbar.title = File.basename(file)
|
|
31
|
-
pbar.inc
|
|
32
|
-
pbar.flush
|
|
33
|
-
|
|
34
|
-
if live
|
|
35
|
-
sh %{ruby #{file} >> #{output}}
|
|
36
|
-
else
|
|
37
|
-
sh %{ruby -Ilib/more -Ilib/core -Ilib/methods #{file} >> #{output}}
|
|
38
|
-
end
|
|
39
|
-
end
|
|
40
|
-
|
|
41
|
-
pbar.finish
|
|
42
|
-
end
|
data/task/test/load
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env ratch
|
|
2
|
-
|
|
3
|
-
# simple load test
|
|
4
|
-
|
|
5
|
-
main :syntax do
|
|
6
|
-
scripts = "lib/**/*.rb"
|
|
7
|
-
libpath = [ 'lib/methods', 'lib/core', 'lib/more' ].join(':')
|
|
8
|
-
|
|
9
|
-
checklist = []
|
|
10
|
-
cnt = 0
|
|
11
|
-
scripts = multiglob(*scripts) #- multiglob_r(ignore)
|
|
12
|
-
scripts.each do |s|
|
|
13
|
-
next unless File.file?(s)
|
|
14
|
-
#if not system "ruby -c -Ibin:lib:test #{s} &> /dev/null" then
|
|
15
|
-
if system("ruby -I#{libpath} #{s} > /dev/null")
|
|
16
|
-
puts "#{s} [PASS]" #if verbose?
|
|
17
|
-
else
|
|
18
|
-
puts "Load Issue: #{s}"
|
|
19
|
-
checklist << :load
|
|
20
|
-
cnt += 1
|
|
21
|
-
end
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
if cnt == 0
|
|
25
|
-
puts "Load dependencies check out."
|
|
26
|
-
else
|
|
27
|
-
puts "#{cnt} Load Failures:\n "
|
|
28
|
-
puts checklist.join("\n ")
|
|
29
|
-
end
|
|
30
|
-
end
|
data/task/test/pairs
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env ratch
|
|
2
|
-
|
|
3
|
-
# cross-run unit tests
|
|
4
|
-
#
|
|
5
|
-
# This tool runs all tests against each other in pairs
|
|
6
|
-
# to ensure across the board compatibility.
|
|
7
|
-
|
|
8
|
-
abort "Not working correctly. Fix me."
|
|
9
|
-
|
|
10
|
-
require "./lib/more/facets/progressbar"
|
|
11
|
-
|
|
12
|
-
main :test do
|
|
13
|
-
output = "doc/log/crosstest.txt"
|
|
14
|
-
|
|
15
|
-
live = ARGV.delete('--live')
|
|
16
|
-
|
|
17
|
-
find = 'test/**/test_*.rb'
|
|
18
|
-
|
|
19
|
-
tests = Dir.glob(find).reject{ |f| dir?(f) }.sort
|
|
20
|
-
tests = tests.sort{ |a,b| File.basename(a) <=> File.basename(b) }
|
|
21
|
-
|
|
22
|
-
File.open(output, 'w'){ |f|
|
|
23
|
-
f << "= CROSS TESTING\n#{Time.now}"
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
total = tests.size * tests.size
|
|
27
|
-
|
|
28
|
-
pbar = Console::ProgressBar.new("CrossTest", total+1)
|
|
29
|
-
pbar.inc
|
|
30
|
-
|
|
31
|
-
tests.each do |file1|
|
|
32
|
-
tests.each do |file2|
|
|
33
|
-
next if file1 == file2
|
|
34
|
-
|
|
35
|
-
sh %{echo "\n\n#{file1} & #{file2}" >> #{output}}
|
|
36
|
-
|
|
37
|
-
pbar.title = File.basename(file1)
|
|
38
|
-
pbar.inc
|
|
39
|
-
pbar.flush
|
|
40
|
-
|
|
41
|
-
if live
|
|
42
|
-
sh %{ruby -r#{file2} #{file1} >> #{output}}
|
|
43
|
-
else
|
|
44
|
-
sh %{ruby -Ilib/more -Ilib/core -Ilib/methods -r#{file2} #{file1} >> #{output}}
|
|
45
|
-
end
|
|
46
|
-
end
|
|
47
|
-
end
|
|
48
|
-
|
|
49
|
-
pbar.finish
|
|
50
|
-
end
|
data/task/test/solo
DELETED
|
@@ -1,294 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env ratch
|
|
2
|
-
|
|
3
|
-
# run tests in separate processes
|
|
4
|
-
|
|
5
|
-
require 'facets/hash/rekey'
|
|
6
|
-
require 'facets/string/tabs'
|
|
7
|
-
require 'facets/progressbar'
|
|
8
|
-
|
|
9
|
-
require 'test/unit/ui/testrunnermediator' #require 'test/unit'
|
|
10
|
-
::Test::Unit.run = true # Don't autorun tests!
|
|
11
|
-
|
|
12
|
-
main :isotestsolid do
|
|
13
|
-
run_isotests
|
|
14
|
-
end
|
|
15
|
-
|
|
16
|
-
# Run unit-tests. Each test is run in a separate interpretor
|
|
17
|
-
# to prevent script clash. This makes for a more robust test
|
|
18
|
-
# facility and prevents potential conflicts between test scripts.
|
|
19
|
-
#
|
|
20
|
-
# tests Test files (eg. test/tc_**/*.rb) [test/**/*]
|
|
21
|
-
# libs Directories to include in load path.
|
|
22
|
-
# ('./lib' is always included)
|
|
23
|
-
# live Deactive use of local libs and test against install.
|
|
24
|
-
# reqs List of files to require prior to running tests.
|
|
25
|
-
# extract Extract embedded tests first? [false]
|
|
26
|
-
#
|
|
27
|
-
# To isolate tests this tool marshals test results across a
|
|
28
|
-
# stdout->stdin shell pipe. This prevents interfence of one
|
|
29
|
-
# script's tests on another. But consequently it is not always
|
|
30
|
-
# possible to send debug info to stdout in the tests themselves
|
|
31
|
-
# (eg. #p and #puts).
|
|
32
|
-
|
|
33
|
-
def run_isotests
|
|
34
|
-
info = configuration['test']
|
|
35
|
-
|
|
36
|
-
tests = info['files'] || 'test/unit/**/test_*.rb'
|
|
37
|
-
libs = info['libpath']
|
|
38
|
-
reqs = info['require']
|
|
39
|
-
live = info['live']
|
|
40
|
-
#extract = info['extract']
|
|
41
|
-
|
|
42
|
-
tests = [ tests ].flatten
|
|
43
|
-
libs = [ libs ].flatten
|
|
44
|
-
|
|
45
|
-
#files = [ @files ].flatten
|
|
46
|
-
#extract_tests if extract
|
|
47
|
-
|
|
48
|
-
results = TestResults.new #(style)
|
|
49
|
-
|
|
50
|
-
# get test files
|
|
51
|
-
test_libs = libs.join(':')
|
|
52
|
-
test_files = Dir.multiglob( *tests )
|
|
53
|
-
if test_files.empty?
|
|
54
|
-
puts "Tests [NONE]"
|
|
55
|
-
return
|
|
56
|
-
end
|
|
57
|
-
|
|
58
|
-
# run tests
|
|
59
|
-
|
|
60
|
-
if trace?
|
|
61
|
-
pbar = nil
|
|
62
|
-
size = test_files.collect{|f| f.size}.max + 5
|
|
63
|
-
dots = '.' * size
|
|
64
|
-
else
|
|
65
|
-
pbar = Console::ProgressBar.new( 'Testing', test_files.size )
|
|
66
|
-
pbar.inc
|
|
67
|
-
end
|
|
68
|
-
|
|
69
|
-
test_files.each do |test_file|
|
|
70
|
-
pbar.inc if pbar
|
|
71
|
-
if ! File.file?(test_file)
|
|
72
|
-
next #r = nil
|
|
73
|
-
else
|
|
74
|
-
unless pbar
|
|
75
|
-
print test_file + dots[test_file.size..-1]
|
|
76
|
-
$stdout.flush
|
|
77
|
-
end
|
|
78
|
-
r = fork_test( test_file, :libs=>libs, :reqs=>reqs, :live=>live )
|
|
79
|
-
unless pbar
|
|
80
|
-
puts r.passed? ? "[PASS]" : "[FAIL]"
|
|
81
|
-
end
|
|
82
|
-
end
|
|
83
|
-
results << r
|
|
84
|
-
end
|
|
85
|
-
|
|
86
|
-
pbar.finish if pbar
|
|
87
|
-
|
|
88
|
-
# display results
|
|
89
|
-
puts results
|
|
90
|
-
|
|
91
|
-
fails, errrs = results.failure_count, results.error_count
|
|
92
|
-
#CHECKLIST << :test if fails > 0
|
|
93
|
-
#CHECKLIST << :test if errrs > 0
|
|
94
|
-
return (fails + errrs > 0)
|
|
95
|
-
end
|
|
96
|
-
|
|
97
|
-
# Run a test in a separate process.
|
|
98
|
-
#
|
|
99
|
-
# Currently send program output to null device.
|
|
100
|
-
# Could send to a logger in future version.
|
|
101
|
-
#
|
|
102
|
-
# Key parameters are libs, reqs, live.
|
|
103
|
-
|
|
104
|
-
def fork_test( file, keys )
|
|
105
|
-
keys = keys.rekey(:to_s)
|
|
106
|
-
|
|
107
|
-
libs = keys['lib'] || []
|
|
108
|
-
reqs = keys['req'] || []
|
|
109
|
-
live = keys['live']
|
|
110
|
-
|
|
111
|
-
src = ''
|
|
112
|
-
|
|
113
|
-
unless live
|
|
114
|
-
l = File.join( Dir.pwd, 'lib' )
|
|
115
|
-
if File.directory?( l )
|
|
116
|
-
src << %{$:.unshift('#{l}')\n}
|
|
117
|
-
end
|
|
118
|
-
libs.each { |r| src << %{$:.unshift('#{r}')\n} }
|
|
119
|
-
end
|
|
120
|
-
|
|
121
|
-
src << %{
|
|
122
|
-
#require 'test/unit'
|
|
123
|
-
require 'test/unit/collector'
|
|
124
|
-
require 'test/unit/collector/objectspace'
|
|
125
|
-
require 'test/unit/ui/testrunnermediator'
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
reqs.each do |fix|
|
|
129
|
-
src << %Q{
|
|
130
|
-
require '#{fix}'
|
|
131
|
-
}
|
|
132
|
-
end
|
|
133
|
-
|
|
134
|
-
src << %{
|
|
135
|
-
def warn(*null); end # silence warnings
|
|
136
|
-
|
|
137
|
-
output = STDOUT.dup
|
|
138
|
-
STDOUT.reopen( PLATFORM =~ /mswin/ ? "NUL" : "/dev/null" )
|
|
139
|
-
|
|
140
|
-
load('#{file}')
|
|
141
|
-
tests = Test::Unit::Collector::ObjectSpace.new.collect
|
|
142
|
-
runner = Test::Unit::UI::TestRunnerMediator.new( tests )
|
|
143
|
-
result = runner.run_suite
|
|
144
|
-
|
|
145
|
-
begin
|
|
146
|
-
marshalled = Marshal.dump(result)
|
|
147
|
-
rescue TypeError => e
|
|
148
|
-
$stderr << "MARSHAL ERROR\n"
|
|
149
|
-
$stderr << "TEST: #{file}\n"
|
|
150
|
-
$stderr << "DATA:" << result.inspect
|
|
151
|
-
exit -1
|
|
152
|
-
end
|
|
153
|
-
output << marshalled
|
|
154
|
-
|
|
155
|
-
STDOUT.reopen(output)
|
|
156
|
-
output.close
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
result = IO.popen("ruby","w+") do |ruby|
|
|
160
|
-
ruby.puts src
|
|
161
|
-
ruby.close_write
|
|
162
|
-
ruby.read
|
|
163
|
-
end
|
|
164
|
-
|
|
165
|
-
begin
|
|
166
|
-
marsh = Marshal.load(result)
|
|
167
|
-
rescue ArgumentError
|
|
168
|
-
$stderr << "\nCannot load marshalled test data.\n"
|
|
169
|
-
$stderr << result << "\n"
|
|
170
|
-
exit -1
|
|
171
|
-
end
|
|
172
|
-
|
|
173
|
-
return marsh
|
|
174
|
-
end
|
|
175
|
-
|
|
176
|
-
#
|
|
177
|
-
# Support class for collecting test results.
|
|
178
|
-
#
|
|
179
|
-
|
|
180
|
-
class TestResults
|
|
181
|
-
attr_reader :assertion_count,
|
|
182
|
-
:run_count,
|
|
183
|
-
:failure_count,
|
|
184
|
-
:error_count
|
|
185
|
-
|
|
186
|
-
attr_accessor :style
|
|
187
|
-
|
|
188
|
-
def initialize( style=nil )
|
|
189
|
-
@style = style
|
|
190
|
-
|
|
191
|
-
@results = []
|
|
192
|
-
|
|
193
|
-
@assertion_count = 0
|
|
194
|
-
@run_count = 0
|
|
195
|
-
@failure_count = 0
|
|
196
|
-
@error_count = 0
|
|
197
|
-
end
|
|
198
|
-
|
|
199
|
-
# Add a result to the results collection.
|
|
200
|
-
|
|
201
|
-
def <<( result )
|
|
202
|
-
@results << result
|
|
203
|
-
|
|
204
|
-
@assertion_count += result.assertion_count
|
|
205
|
-
@run_count += result.run_count
|
|
206
|
-
@failure_count += result.failure_count
|
|
207
|
-
@error_count += result.error_count
|
|
208
|
-
end
|
|
209
|
-
|
|
210
|
-
#
|
|
211
|
-
|
|
212
|
-
def errors
|
|
213
|
-
errors = []
|
|
214
|
-
@results.each do |r|
|
|
215
|
-
unless r.passed?
|
|
216
|
-
errors << r.instance_variable_get('@errors')
|
|
217
|
-
end
|
|
218
|
-
end
|
|
219
|
-
errors.reject! { |e| e == [] }
|
|
220
|
-
errors
|
|
221
|
-
end
|
|
222
|
-
|
|
223
|
-
#
|
|
224
|
-
|
|
225
|
-
def failures
|
|
226
|
-
failures = []
|
|
227
|
-
@results.each do |r|
|
|
228
|
-
unless r.passed?
|
|
229
|
-
failures << r.instance_variable_get('@failures')
|
|
230
|
-
end
|
|
231
|
-
end
|
|
232
|
-
failures.reject! { |e| e == [] }
|
|
233
|
-
failures
|
|
234
|
-
end
|
|
235
|
-
|
|
236
|
-
# Output format for test results.
|
|
237
|
-
|
|
238
|
-
def to_s
|
|
239
|
-
return @results.to_s if style == 'pease'
|
|
240
|
-
|
|
241
|
-
s = []
|
|
242
|
-
# Display failures
|
|
243
|
-
unless failures.empty?
|
|
244
|
-
s << ''
|
|
245
|
-
s << "FAILURES:"
|
|
246
|
-
failures.reverse.each do |fails|
|
|
247
|
-
fails.reverse.each do |failure|
|
|
248
|
-
#puts
|
|
249
|
-
s << %{ - test : #{failure.test_name}}
|
|
250
|
-
s << %{ location : #{failure.location}}
|
|
251
|
-
if failure.message.index("\n")
|
|
252
|
-
s << %{ message : >}
|
|
253
|
-
s << failure.message.tabto(6)
|
|
254
|
-
else
|
|
255
|
-
s << %{ message : #{failure.message}}
|
|
256
|
-
end
|
|
257
|
-
end
|
|
258
|
-
end
|
|
259
|
-
end
|
|
260
|
-
|
|
261
|
-
# Display errors
|
|
262
|
-
unless errors.empty?
|
|
263
|
-
s << ''
|
|
264
|
-
s << "ERRORS:"
|
|
265
|
-
errors.reverse.each do |errs|
|
|
266
|
-
errs.reverse.each do |err|
|
|
267
|
-
s << ''
|
|
268
|
-
s << %{ - test : #{err.test_name}}
|
|
269
|
-
s << %{ message : #{err.exception.message}}
|
|
270
|
-
s << %{ backtrace :}
|
|
271
|
-
err.exception.backtrace[0...-1].each { |bt| s << %Q{ - #{bt}} }
|
|
272
|
-
end
|
|
273
|
-
end
|
|
274
|
-
end
|
|
275
|
-
|
|
276
|
-
# Display final results
|
|
277
|
-
s << ''
|
|
278
|
-
s << "Summary:"
|
|
279
|
-
s << " Tests : #{@run_count}"
|
|
280
|
-
s << " Assertions : #{@assertion_count}"
|
|
281
|
-
s << " Failures : #{@failure_count}"
|
|
282
|
-
s << " Errors : #{@error_count}"
|
|
283
|
-
s << ''
|
|
284
|
-
s << ''
|
|
285
|
-
|
|
286
|
-
return s.join("\n")
|
|
287
|
-
end
|
|
288
|
-
|
|
289
|
-
# Delegate missing call to the results array.
|
|
290
|
-
|
|
291
|
-
def method_missing(*a,&b)
|
|
292
|
-
@results.send(*a,&b)
|
|
293
|
-
end
|
|
294
|
-
end
|
data/task/test/syntax
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env ratch
|
|
2
|
-
|
|
3
|
-
# check syntax
|
|
4
|
-
|
|
5
|
-
main :syntax do
|
|
6
|
-
scripts = "lib/**/*.rb"
|
|
7
|
-
libpath = [ 'lib/methods', 'lib/core', 'lib/more' ].join(':')
|
|
8
|
-
|
|
9
|
-
checklist = []
|
|
10
|
-
cnt = 0
|
|
11
|
-
scripts = multiglob(*scripts) #- multiglob_r(ignore)
|
|
12
|
-
scripts.each do |s|
|
|
13
|
-
next unless File.file?(s)
|
|
14
|
-
#if not system "ruby -c -Ibin:lib:test #{s} &> /dev/null" then
|
|
15
|
-
r = system "ruby -c -I#{libpath} #{s} > /dev/null"
|
|
16
|
-
if r
|
|
17
|
-
puts "#{s} [PASS]" #if verbose?
|
|
18
|
-
else
|
|
19
|
-
puts "Syntax Error: #{s}"
|
|
20
|
-
checklist << :syntax
|
|
21
|
-
cnt += 1
|
|
22
|
-
end
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
if cnt == 0
|
|
26
|
-
puts "Syntax checks out."
|
|
27
|
-
else
|
|
28
|
-
puts "#{cnt} Syntax Failures:\n "
|
|
29
|
-
puts checklist.join("\n ")
|
|
30
|
-
end
|
|
31
|
-
end
|