tracksperanto 4.1.2 → 4.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/tracksperanto/version.rb +1 -1
- data/test/HELP_WHY_TESTS_ARE_EMPTY.md +8 -0
- data/tracksperanto.gemspec +2 -4
- metadata +4 -179
- data/test/export/README_EXPORT_TESTS.txt +0 -24
- data/test/export/samples/ref_AfterEffects.jsx +0 -70
- data/test/export/samples/ref_FlameProperlyReorderedCornerpin.stabilizer +0 -1946
- data/test/export/samples/ref_FlameSimpleReorderedCornerpin.stabilizer +0 -1946
- data/test/export/samples/ref_Maxscript.ms +0 -93
- data/test/export/samples/ref_MayaLocators.ma +0 -90
- data/test/export/samples/ref_Mayalive.txt +0 -43
- data/test/export/samples/ref_Mayalive_CustomAspect.txt +0 -43
- data/test/export/samples/ref_NukeCameraTrackerUsertracks.txt +0 -48
- data/test/export/samples/ref_NukeScript.nk +0 -37
- data/test/export/samples/ref_PFMatchit.2dt +0 -54
- data/test/export/samples/ref_PFTrack.2dt +0 -51
- data/test/export/samples/ref_PFTrack5.2dt +0 -54
- data/test/export/samples/ref_Ruby.rb +0 -54
- data/test/export/samples/ref_ShakeText.txt +0 -48
- data/test/export/samples/ref_Syntheyes.txt +0 -39
- data/test/export/samples/ref_XSI.py +0 -102
- data/test/export/samples/ref_boujou.txt +0 -44
- data/test/export/samples/ref_equalizer.txt +0 -49
- data/test/export/samples/ref_equalizer3.txt +0 -44
- data/test/export/samples/ref_flame.stabilizer +0 -962
- data/test/export/samples/ref_flameCornerpin.stabilizer +0 -962
- data/test/export/samples/ref_flame_2014.stabilizer +0 -893
- data/test/export/samples/ref_flame_2014_cornerpin.stabilizer +0 -1422
- data/test/export/samples/ref_matchmover.rz2 +0 -52
- data/test/export/test_ae_export.rb +0 -16
- data/test/export/test_boujou_export.rb +0 -17
- data/test/export/test_equalizer3_export.rb +0 -24
- data/test/export/test_equalizer_export.rb +0 -15
- data/test/export/test_flame_stabilizer_2014_cornerpin_export.rb +0 -33
- data/test/export/test_flame_stabilizer_2014_export.rb +0 -17
- data/test/export/test_flame_stabilizer_cornerpin_export.rb +0 -71
- data/test/export/test_flame_stabilizer_export.rb +0 -17
- data/test/export/test_match_mover_export.rb +0 -25
- data/test/export/test_maxscript.rb +0 -16
- data/test/export/test_maya_live_export.rb +0 -17
- data/test/export/test_maya_locators_export.rb +0 -16
- data/test/export/test_mux.rb +0 -23
- data/test/export/test_nuke_camtracker_export.rb +0 -15
- data/test/export/test_nuke_export.rb +0 -45
- data/test/export/test_pfmatchit_export.rb +0 -16
- data/test/export/test_pftrack5_export.rb +0 -19
- data/test/export/test_pftrack_export.rb +0 -19
- data/test/export/test_ruby_export.rb +0 -15
- data/test/export/test_shake_export.rb +0 -15
- data/test/export/test_syntheyes_export.rb +0 -15
- data/test/export/test_xsi_python_export.rb +0 -16
- data/test/helper.rb +0 -153
- data/test/import/README.rdoc +0 -10
- data/test/import/samples/3de_v3/3de_export_v3.txt +0 -2203
- data/test/import/samples/3de_v4/3de_export_cube.txt +0 -726
- data/test/import/samples/3de_v4/FB1880_man_v05.txt +0 -2402
- data/test/import/samples/boujou_features_text/boujou_txt_export.txt +0 -2885
- data/test/import/samples/flame_stabilizer/FlameStab_Cornerpin_CorrectOrder.stabilizer +0 -2758
- data/test/import/samples/flame_stabilizer/FlameStab_Cornerpin_IncorrectOrder.stabilizer +0 -2758
- data/test/import/samples/flame_stabilizer/Flame_Stabilizer_2012.stabilizer +0 -6954
- data/test/import/samples/flame_stabilizer/cornerpin_2012.stabilizer +0 -20958
- data/test/import/samples/flame_stabilizer/flame2010_cornerpin.stabilizer +0 -10792
- data/test/import/samples/flame_stabilizer/flame_2012_another.stabilizer +0 -2290
- data/test/import/samples/flame_stabilizer/fromCombustion_fromMidClip_wSnap.stabilizer +0 -2028
- data/test/import/samples/flame_stabilizer/fromTracksperanto.stabilizer +0 -541
- data/test/import/samples/flame_stabilizer/hugeFlameSetup.stabilizer +0 -263460
- data/test/import/samples/flame_stabilizer/megaTrack.action.3dtrack.stabilizer +0 -29793
- data/test/import/samples/flame_stabilizer/stabilizer_2014_ref_for_reexport.stabilizer +0 -2776
- data/test/import/samples/flame_stabilizer/stabilizer_2014_stp.stabilizer +0 -2536
- data/test/import/samples/match_mover/2dtracks.rz2 +0 -2076
- data/test/import/samples/match_mover/EP_1000_head_trackers_v002.rz2 +0 -935
- data/test/import/samples/match_mover/NonSequentialMatchmoverPoints.rz2 +0 -93306
- data/test/import/samples/match_mover/cha_171_1020_atb_v001.rz2 +0 -238
- data/test/import/samples/match_mover/kipPointsMatchmover.rz2 +0 -523
- data/test/import/samples/match_mover_rzml/md_145_1070_right_t1.rzml +0 -601
- data/test/import/samples/mayalive/mayalive_kipShot.txt +0 -1504
- data/test/import/samples/nuke/018.nk +0 -300
- data/test/import/samples/nuke/45trackers.nk +0 -331
- data/test/import/samples/nuke/A099_L008_0207TW_001_head_R.nk +0 -135
- data/test/import/samples/nuke/cornerpin.nk +0 -11
- data/test/import/samples/nuke/curve-start-with-curve-command.nk +0 -174
- data/test/import/samples/nuke/failing_nuke7_trackers_job_1872.nk +0 -112
- data/test/import/samples/nuke/nuke708_tracker.nk +0 -52
- data/test/import/samples/nuke/nuke7_planar.nk +0 -3143
- data/test/import/samples/nuke/nuke7_tracker_2tracks.nk +0 -116
- data/test/import/samples/nuke/nuke7_transform2d.nk +0 -69
- data/test/import/samples/nuke/nuke8_tracker4_copypastes.nk +0 -53
- data/test/import/samples/nuke/one_tracker_with_break.nk +0 -71
- data/test/import/samples/nuke/one_tracker_with_break_in_grp.nk +0 -91
- data/test/import/samples/nuke/planar.nk +0 -37692
- data/test/import/samples/nuke/reconciles.nk +0 -210
- data/test/import/samples/nuke/sh110_trackers_004_ipad1.nk +0 -56
- data/test/import/samples/nuke/skip_invalid_curve_expressions.nk +0 -62
- data/test/import/samples/nuke/track_nuke8.nk +0 -54
- data/test/import/samples/nuke/tracker4_with_empty_tracks_knob.nk +0 -13005
- data/test/import/samples/nuke/tracker_with_differing_gaps.nk +0 -82
- data/test/import/samples/nuke/tracker_with_repeating_gaps.nk +0 -79
- data/test/import/samples/pfmatchit/pfmatchit_example.2dt +0 -90
- data/test/import/samples/pftrack4/sourcefile_pftrack.2dt +0 -28972
- data/test/import/samples/pftrack5/apft.2dt +0 -164
- data/test/import/samples/pftrack5/empty_trackers.2dt +0 -30
- data/test/import/samples/pftrack5/garage.2dt +0 -79259
- data/test/import/samples/pftrack5/stereo.2dt +0 -21073
- data/test/import/samples/shake_script/205_030_shaketrack_v01_pd.shk +0 -379
- data/test/import/samples/shake_script/REDACTED_shake_file.shk +0 -317
- data/test/import/samples/shake_script/cliff_many_stabilize.shk +0 -675
- data/test/import/samples/shake_script/comments_inline_with_args.shk +0 -50
- data/test/import/samples/shake_script/designated_global_range_starting_at_negative_frame.shk +0 -496
- data/test/import/samples/shake_script/four_tracks_in_one_matchmove.shk +0 -323
- data/test/import/samples/shake_script/four_tracks_in_one_stabilizer.shk +0 -321
- data/test/import/samples/shake_script/from_matchmover.shk +0 -140
- data/test/import/samples/shake_script/ofx_vardefs.shk +0 -6
- data/test/import/samples/shake_script/oldTrackerNode.shk +0 -5
- data/test/import/samples/shake_script/shake_script_from_boujou.shk +0 -15
- data/test/import/samples/shake_script/shake_tracker_nodes.shk +0 -633
- data/test/import/samples/shake_script/shake_tracker_with_no_anim.shk +0 -6
- data/test/import/samples/shake_script/shake_trackers_with_Nspline.shk +0 -328
- data/test/import/samples/shake_script/stabilize_nodes_with_hermite.shk +0 -330
- data/test/import/samples/shake_script/three_tracks_in_one_stabilizer.shk +0 -320
- data/test/import/samples/shake_script/track.shk +0 -349
- data/test/import/samples/shake_script/two_tracks_in_one_tracker.shk +0 -319
- data/test/import/samples/shake_text/nuke_camtracker.txt +0 -11240
- data/test/import/samples/shake_text/one_shake_tracker.txt +0 -49
- data/test/import/samples/shake_text/one_shake_tracker_from_first.txt +0 -188
- data/test/import/samples/shake_text/two_shake_trackers.txt +0 -78
- data/test/import/samples/syntheyes_2d_paths/cola_plate.txt +0 -507
- data/test/import/samples/syntheyes_2d_paths/flyover2DP_syntheyes.txt +0 -12687
- data/test/import/samples/syntheyes_2d_paths/morePoints_sy2010.txt +0 -752
- data/test/import/samples/syntheyes_2d_paths/one_tracker.txt +0 -49
- data/test/import/samples/syntheyes_2d_paths/shake_tracker_nodes_to_syntheyes.txt +0 -4091
- data/test/import/samples/syntheyes_all_tracker_paths/shot06_2dTracks.txt +0 -6255
- data/test/import/test_3de_import.rb +0 -41
- data/test/import/test_3de_import3.rb +0 -33
- data/test/import/test_boujou_import.rb +0 -29
- data/test/import/test_flame_import.rb +0 -120
- data/test/import/test_match_mover_import.rb +0 -100
- data/test/import/test_match_mover_rzml_import.rb +0 -33
- data/test/import/test_maya_live_import.rb +0 -57
- data/test/import/test_nuke_import.rb +0 -298
- data/test/import/test_pftrack_import.rb +0 -94
- data/test/import/test_shake_catcher.rb +0 -85
- data/test/import/test_shake_lexer.rb +0 -204
- data/test/import/test_shake_script_import.rb +0 -164
- data/test/import/test_shake_text_import.rb +0 -71
- data/test/import/test_syntheyes_all_tracker_paths_import.rb +0 -26
- data/test/import/test_syntheyes_import.rb +0 -51
- data/test/test_blacklist.rb +0 -50
- data/test/test_block_init.rb +0 -48
- data/test/test_buffer_io.rb +0 -33
- data/test/test_casts.rb +0 -76
- data/test/test_cli.rb +0 -108
- data/test/test_const_name.rb +0 -12
- data/test/test_extio.rb +0 -28
- data/test/test_format_detector.rb +0 -39
- data/test/test_keyframe.rb +0 -56
- data/test/test_parameters.rb +0 -37
- data/test/test_pipeline.rb +0 -192
- data/test/test_safety.rb +0 -20
- data/test/test_simple_export.rb +0 -22
- data/test/test_tracker.rb +0 -149
- data/test/test_tracksperanto.rb +0 -88
- data/test/test_uv_coords.rb +0 -28
- data/test/test_yield_non_empty.rb +0 -10
- data/test/test_zip_tuples.rb +0 -31
- data/test/tools/test_crop_middleware.rb +0 -32
- data/test/tools/test_flip_middleware.rb +0 -18
- data/test/tools/test_flop_middleware.rb +0 -18
- data/test/tools/test_golden_middleware.rb +0 -25
- data/test/tools/test_length_cutoff_middleware.rb +0 -43
- data/test/tools/test_lens_middleware.rb +0 -77
- data/test/tools/test_lerp_middleware.rb +0 -28
- data/test/tools/test_lint_middleware.rb +0 -79
- data/test/tools/test_move_to_first_frame_middleware.rb +0 -37
- data/test/tools/test_pad_middleware.rb +0 -35
- data/test/tools/test_prefix.rb +0 -31
- data/test/tools/test_reformat_middleware.rb +0 -36
- data/test/tools/test_scaler_middleware.rb +0 -66
- data/test/tools/test_shift_middleware.rb +0 -31
- data/test/tools/test_slip_middleware.rb +0 -36
- data/test/tools/test_start_trim_middleware.rb +0 -36
@@ -1,71 +0,0 @@
|
|
1
|
-
require File.expand_path(File.dirname(__FILE__)) + '/../helper'
|
2
|
-
|
3
|
-
class ShakeTextImportTest < Test::Unit::TestCase
|
4
|
-
DELTA = 0.000001
|
5
|
-
|
6
|
-
def test_introspects_properly
|
7
|
-
i = Tracksperanto::Import::ShakeText
|
8
|
-
assert_equal "Shake .txt tracker file and Nuke CameraTracker auto tracks export", i.human_name
|
9
|
-
assert !i.autodetects_size?
|
10
|
-
end
|
11
|
-
|
12
|
-
def test_parsing
|
13
|
-
fixture = File.open(File.dirname(__FILE__) + '/samples/shake_text/one_shake_tracker.txt')
|
14
|
-
trackers = Tracksperanto::Import::ShakeText.new(:io => fixture).to_a
|
15
|
-
|
16
|
-
assert_kind_of Enumerable, trackers
|
17
|
-
assert_equal 1, trackers.length
|
18
|
-
|
19
|
-
t = trackers[0]
|
20
|
-
|
21
|
-
assert_kind_of Tracksperanto::Tracker, t
|
22
|
-
assert_equal 46, t.keyframes.length
|
23
|
-
assert_equal "track1", t.name
|
24
|
-
|
25
|
-
second_kf = t.keyframes[1]
|
26
|
-
assert_in_delta 121, second_kf.frame, DELTA
|
27
|
-
assert_in_delta 373.746, second_kf.abs_x, DELTA
|
28
|
-
assert_in_delta 984.564, second_kf.abs_y, DELTA
|
29
|
-
assert_in_delta 0.002, second_kf.residual, DELTA
|
30
|
-
end
|
31
|
-
|
32
|
-
def test_parsing_two_trackers
|
33
|
-
fixture = File.open(File.dirname(__FILE__) + '/samples/shake_text/two_shake_trackers.txt')
|
34
|
-
trackers = Tracksperanto::Import::ShakeText.new(:io => fixture).to_a
|
35
|
-
|
36
|
-
assert_kind_of Enumerable, trackers
|
37
|
-
assert_equal 2, trackers.length
|
38
|
-
|
39
|
-
t = trackers[0]
|
40
|
-
|
41
|
-
assert_equal "track1", t.name
|
42
|
-
assert_kind_of Tracksperanto::Tracker, t
|
43
|
-
assert_equal 6, t.keyframes.length
|
44
|
-
|
45
|
-
second_kf = t.keyframes[1]
|
46
|
-
assert_in_delta 111, second_kf.frame, DELTA
|
47
|
-
|
48
|
-
t2 = trackers[-1]
|
49
|
-
assert_equal "track2", t2.name
|
50
|
-
end
|
51
|
-
|
52
|
-
def test_parsing_from_nuke_camera_tracker
|
53
|
-
fixture = File.open(File.dirname(__FILE__) + '/samples/shake_text/nuke_camtracker.txt')
|
54
|
-
trackers = Tracksperanto::Import::ShakeText.new(:io => fixture).to_a
|
55
|
-
|
56
|
-
assert_kind_of Enumerable, trackers
|
57
|
-
assert_equal 261, trackers.length
|
58
|
-
|
59
|
-
t = trackers[0]
|
60
|
-
|
61
|
-
assert_equal "autotrack0", t.name
|
62
|
-
assert_kind_of Tracksperanto::Tracker, t
|
63
|
-
assert_equal 11, t.keyframes.length
|
64
|
-
|
65
|
-
second_kf = t.keyframes[1]
|
66
|
-
assert_in_delta 1, second_kf.frame, DELTA
|
67
|
-
|
68
|
-
t2 = trackers[-1]
|
69
|
-
assert_equal "autotrack260", t2.name
|
70
|
-
end
|
71
|
-
end
|
@@ -1,26 +0,0 @@
|
|
1
|
-
require File.expand_path(File.dirname(__FILE__)) + '/../helper'
|
2
|
-
|
3
|
-
class SyntheyesAllPathsImportTest < Test::Unit::TestCase
|
4
|
-
DELTA = 0.001 # our SynthEyes sample is somewhat inaccurate :-P
|
5
|
-
|
6
|
-
def test_introspects_properly
|
7
|
-
i = Tracksperanto::Import::SyntheyesAllTrackerPaths
|
8
|
-
assert_equal "Syntheyes \"All Tracker Paths\" export .txt file", i.human_name
|
9
|
-
assert !i.autodetects_size?
|
10
|
-
assert_not_nil i.known_snags
|
11
|
-
assert !i.known_snags.empty?
|
12
|
-
end
|
13
|
-
|
14
|
-
def test_parsing_from_importable
|
15
|
-
fixture = File.open(File.dirname(__FILE__) + '/samples/syntheyes_all_tracker_paths/shot06_2dTracks.txt')
|
16
|
-
trackers = Tracksperanto::Import::SyntheyesAllTrackerPaths.new(:io => fixture, :width => 2560, :height => 1080).to_a
|
17
|
-
assert_equal 139, trackers.length
|
18
|
-
assert_equal "Tracker2_", trackers[0].name
|
19
|
-
assert_equal "Tracker3_", trackers[1].name
|
20
|
-
assert_equal 44, trackers[0].length
|
21
|
-
|
22
|
-
first_kf = trackers[0].at_frame(0)
|
23
|
-
assert_in_delta 760.632, first_kf.abs_x, DELTA
|
24
|
-
assert_in_delta 760.0, first_kf.abs_y, DELTA
|
25
|
-
end
|
26
|
-
end
|
@@ -1,51 +0,0 @@
|
|
1
|
-
require File.expand_path(File.dirname(__FILE__)) + '/../helper'
|
2
|
-
|
3
|
-
class SyntheyesImportTest < Test::Unit::TestCase
|
4
|
-
DELTA = 0.01 # our SynthEyes sample is somewhat inaccurate :-P
|
5
|
-
|
6
|
-
def test_introspects_properly
|
7
|
-
i = Tracksperanto::Import::Syntheyes
|
8
|
-
assert_equal 'Syntheyes "Tracker 2-D paths" file', i.human_name
|
9
|
-
assert !i.autodetects_size?
|
10
|
-
assert_not_nil i.known_snags
|
11
|
-
assert !i.known_snags.empty?
|
12
|
-
end
|
13
|
-
|
14
|
-
def test_parsing_from_importable
|
15
|
-
fixture = File.open(File.dirname(__FILE__) + '/samples/syntheyes_2d_paths/shake_tracker_nodes_to_syntheyes.txt')
|
16
|
-
trackers = Tracksperanto::Import::Syntheyes.new(:io => fixture, :width => 2560, :height => 1080).to_a
|
17
|
-
|
18
|
-
assert_equal 50, trackers.length
|
19
|
-
|
20
|
-
first_kf = trackers[0].keyframes[0]
|
21
|
-
|
22
|
-
assert_equal "Tracker1", trackers[0].name
|
23
|
-
|
24
|
-
assert_equal 0, first_kf.frame
|
25
|
-
assert_in_delta 715.221, first_kf.abs_x, DELTA
|
26
|
-
assert_in_delta 885.679, first_kf.abs_y, DELTA
|
27
|
-
assert_in_delta 0.0, first_kf.residual, DELTA
|
28
|
-
end
|
29
|
-
|
30
|
-
def test_parsing_cola_plate
|
31
|
-
fixture = File.open(File.dirname(__FILE__) + '/samples/syntheyes_2d_paths/cola_plate.txt')
|
32
|
-
trackers = Tracksperanto::Import::Syntheyes.new(:io => fixture, :width => 1920, :height => 1080).to_a
|
33
|
-
|
34
|
-
assert_equal 6, trackers.length
|
35
|
-
end
|
36
|
-
|
37
|
-
def test_parsing_with_one_tracker
|
38
|
-
fixture = File.open(File.dirname(__FILE__) + '/samples/syntheyes_2d_paths/one_tracker.txt')
|
39
|
-
trackers = Tracksperanto::Import::Syntheyes.new(:io => fixture, :width => 1920, :height => 1080).to_a
|
40
|
-
|
41
|
-
assert_equal 1, trackers.length
|
42
|
-
assert_equal 49, trackers[0].length
|
43
|
-
end
|
44
|
-
|
45
|
-
def test_parsing_from_sy_2010
|
46
|
-
fixture = File.open(File.dirname(__FILE__) + '/samples/syntheyes_2d_paths/morePoints_sy2010.txt')
|
47
|
-
trackers = Tracksperanto::Import::Syntheyes.new(:io => fixture, :width => 1920, :height => 1080).to_a
|
48
|
-
|
49
|
-
assert_equal 26, trackers.length
|
50
|
-
end
|
51
|
-
end
|
data/test/test_blacklist.rb
DELETED
@@ -1,50 +0,0 @@
|
|
1
|
-
require File.expand_path(File.dirname(__FILE__)) + '/helper'
|
2
|
-
|
3
|
-
class TestBlacklist < Test::Unit::TestCase
|
4
|
-
|
5
|
-
def test_non_blacklisted_formats
|
6
|
-
%w( file.txt file.2dt file.stabilizer ).each do | filename |
|
7
|
-
Tracksperanto::Blacklist.raise_if_format_unsupported(filename)
|
8
|
-
end
|
9
|
-
assert true, 'No exceptions should have been raised'
|
10
|
-
end
|
11
|
-
|
12
|
-
def test_blacklisted_formats
|
13
|
-
%w(
|
14
|
-
file.jpg
|
15
|
-
file.tif
|
16
|
-
file.tiff
|
17
|
-
file.mov
|
18
|
-
file.r3d
|
19
|
-
file.dpx
|
20
|
-
file.jpg
|
21
|
-
file.gif
|
22
|
-
file.PNG
|
23
|
-
file.sni
|
24
|
-
file.ma
|
25
|
-
file.mb
|
26
|
-
file.ptp
|
27
|
-
file.pfb
|
28
|
-
file.pfmp
|
29
|
-
file.mmf
|
30
|
-
file.doc
|
31
|
-
file.docx
|
32
|
-
file.ppt
|
33
|
-
file.pptx
|
34
|
-
file.xls
|
35
|
-
file.xlsx
|
36
|
-
file.fbx
|
37
|
-
file.abc
|
38
|
-
file.3de
|
39
|
-
file.bpj
|
40
|
-
file.py
|
41
|
-
file.ascii
|
42
|
-
file.c4d
|
43
|
-
).each do | filename |
|
44
|
-
error = assert_raise(Tracksperanto::UnsupportedFormatError, "Should fail for #{filename.inspect}") do
|
45
|
-
Tracksperanto::Blacklist.raise_if_format_unsupported(filename)
|
46
|
-
end
|
47
|
-
assert_operator error.message.length, :>, 5, 'Should contain a descriptive error message'
|
48
|
-
end
|
49
|
-
end
|
50
|
-
end
|
data/test/test_block_init.rb
DELETED
@@ -1,48 +0,0 @@
|
|
1
|
-
require File.expand_path(File.dirname(__FILE__)) + '/helper'
|
2
|
-
|
3
|
-
class TestBlockInit < Test::Unit::TestCase
|
4
|
-
|
5
|
-
class Settable
|
6
|
-
include Tracksperanto::BlockInit
|
7
|
-
|
8
|
-
attr_accessor :foo, :bar
|
9
|
-
|
10
|
-
private
|
11
|
-
def privatized=(something)
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
def test_block_init_with_hash
|
16
|
-
s = Settable.new(:foo => "x", :bar => "y")
|
17
|
-
assert_equal "x", s.foo
|
18
|
-
assert_equal "y", s.bar
|
19
|
-
end
|
20
|
-
|
21
|
-
def test_block_init_with_hash_raises_on_unknown_attribute
|
22
|
-
assert_raise(NoMethodError) { Settable.new(:nonexistent => true) }
|
23
|
-
end
|
24
|
-
|
25
|
-
def test_block_init_with_block_yields_the_object
|
26
|
-
within_blk = nil
|
27
|
-
s = Settable.new do | f |
|
28
|
-
within_blk = f
|
29
|
-
f.foo = "x"
|
30
|
-
end
|
31
|
-
|
32
|
-
assert_equal s, within_blk, "Should have yielded the object to the blk"
|
33
|
-
assert_equal "x", s.foo
|
34
|
-
end
|
35
|
-
|
36
|
-
def test_block_init_attributes_overwrite_hash_attributes
|
37
|
-
s = Settable.new(:foo => "bar") { |f| f.foo = "x" }
|
38
|
-
assert_equal "x", s.foo
|
39
|
-
end
|
40
|
-
|
41
|
-
if RUBY_VERSION > '1.9'
|
42
|
-
def test_block_init_uses_public_send
|
43
|
-
assert_raise(NoMethodError) { Settable.new(:privatized => true) }
|
44
|
-
end
|
45
|
-
end
|
46
|
-
|
47
|
-
|
48
|
-
end
|
data/test/test_buffer_io.rb
DELETED
@@ -1,33 +0,0 @@
|
|
1
|
-
require File.expand_path(File.dirname(__FILE__)) + '/helper'
|
2
|
-
|
3
|
-
class TestBufferIO < Test::Unit::TestCase
|
4
|
-
|
5
|
-
def test_write_in_mem_has_a_stringio
|
6
|
-
io = Tracksperanto::BufferIO.new
|
7
|
-
9000.times { io.write("a") }
|
8
|
-
assert_kind_of StringIO, io.backing_buffer
|
9
|
-
assert_nothing_raised { io.close! }
|
10
|
-
end
|
11
|
-
|
12
|
-
def test_write_larger_than_max_swaps_tempfile
|
13
|
-
io = Tracksperanto::BufferIO.new
|
14
|
-
io.write("a" * 6_000_001)
|
15
|
-
f = io.backing_buffer
|
16
|
-
assert_kind_of Tempfile, f
|
17
|
-
f.rewind
|
18
|
-
assert_equal 6_000_001, f.read.length
|
19
|
-
flexmock(f).should_receive(:close!).once
|
20
|
-
io.close!
|
21
|
-
end
|
22
|
-
|
23
|
-
def test_to_file_forces_immediate_promotion_to_file
|
24
|
-
io = Tracksperanto::BufferIO.new
|
25
|
-
io.write("a" * 3000)
|
26
|
-
assert_equal 3000, io.pos
|
27
|
-
assert !io.file_backed?
|
28
|
-
|
29
|
-
f = io.to_file
|
30
|
-
assert_equal 3000, f.pos
|
31
|
-
assert f.file_backed?
|
32
|
-
end
|
33
|
-
end
|
data/test/test_casts.rb
DELETED
@@ -1,76 +0,0 @@
|
|
1
|
-
require File.expand_path(File.dirname(__FILE__)) + '/helper'
|
2
|
-
|
3
|
-
class TestCasts < Test::Unit::TestCase
|
4
|
-
D = 0.0001
|
5
|
-
|
6
|
-
class Testable
|
7
|
-
include Tracksperanto::Casts
|
8
|
-
attr_accessor :vanilla, :str_attr, :int_attr, :float_attr
|
9
|
-
cast_to_string :str_attr
|
10
|
-
cast_to_int :int_attr
|
11
|
-
cast_to_float :float_attr
|
12
|
-
cast_to_bool :truthy
|
13
|
-
end
|
14
|
-
|
15
|
-
class Junk
|
16
|
-
def to_s
|
17
|
-
"Random"
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
def test_cast_to_float
|
22
|
-
t = Testable.new
|
23
|
-
assert_kind_of Float, t.float_attr, "Uninitialized float attr should be a float"
|
24
|
-
assert_in_delta 0, t.float_attr, D
|
25
|
-
|
26
|
-
t.float_attr = "3"
|
27
|
-
assert_kind_of Float, t.float_attr
|
28
|
-
assert_in_delta 3.0, t.float_attr, D
|
29
|
-
|
30
|
-
t.float_attr = "a"
|
31
|
-
assert_kind_of Float, t.float_attr
|
32
|
-
assert_in_delta 0, t.float_attr, D
|
33
|
-
end
|
34
|
-
|
35
|
-
def test_cast_to_bool
|
36
|
-
t = Testable.new
|
37
|
-
assert_equal false, t.truthy
|
38
|
-
|
39
|
-
t.truthy = nil
|
40
|
-
assert_equal false, t.truthy
|
41
|
-
|
42
|
-
t.truthy = false
|
43
|
-
assert_equal false, t.truthy
|
44
|
-
|
45
|
-
t.truthy = "yes"
|
46
|
-
assert_equal true, t.truthy
|
47
|
-
|
48
|
-
t.truthy = 1
|
49
|
-
assert_equal true, t.truthy
|
50
|
-
end
|
51
|
-
|
52
|
-
def test_cast_to_int
|
53
|
-
t = Testable.new
|
54
|
-
|
55
|
-
assert_equal 0, t.int_attr, "Uninitialized int attr should be an int"
|
56
|
-
|
57
|
-
t.int_attr = "3.1"
|
58
|
-
assert_kind_of Integer, t.int_attr
|
59
|
-
assert_equal 3, t.int_attr
|
60
|
-
|
61
|
-
t.float_attr = 3.1
|
62
|
-
assert_kind_of Integer, t.int_attr
|
63
|
-
assert_equal 3, t.int_attr
|
64
|
-
end
|
65
|
-
|
66
|
-
def test_cast_to_string
|
67
|
-
t = Testable.new
|
68
|
-
|
69
|
-
assert_equal '', t.str_attr
|
70
|
-
t.str_attr = 3.123
|
71
|
-
assert_equal "3.123", t.str_attr
|
72
|
-
|
73
|
-
t.str_attr = Junk.new
|
74
|
-
assert_equal "Random", t.str_attr
|
75
|
-
end
|
76
|
-
end
|
data/test/test_cli.rb
DELETED
@@ -1,108 +0,0 @@
|
|
1
|
-
require File.expand_path(File.dirname(__FILE__)) + '/helper'
|
2
|
-
require "set"
|
3
|
-
require "cli_test"
|
4
|
-
|
5
|
-
class TestCli < Test::Unit::TestCase
|
6
|
-
BIN_P = File.expand_path(File.dirname(__FILE__) + "/../bin/tracksperanto")
|
7
|
-
|
8
|
-
# Wraps in_temp_dir but sneaks a prefab file into it
|
9
|
-
def with_stabilizer_in_temp_dir
|
10
|
-
test_f = File.expand_path(File.dirname(__FILE__)) + "/import/samples/flame_stabilizer/fromCombustion_fromMidClip_wSnap.stabilizer"
|
11
|
-
in_temp_dir do | where |
|
12
|
-
FileUtils.cp(test_f, where + "/flm.stabilizer")
|
13
|
-
yield(where)
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
# Run the tracksperanto binary with passed options, and return [exit_code, stdout_content, stderr_content]
|
18
|
-
def cli(commandline_arguments)
|
19
|
-
CLITest.new(BIN_P).run(commandline_arguments)
|
20
|
-
end
|
21
|
-
|
22
|
-
def test_cli_with_no_args_produces_usage
|
23
|
-
status, o, e = cli('')
|
24
|
-
assert_equal 1, status
|
25
|
-
assert_match /Also use the --help option/, e
|
26
|
-
end
|
27
|
-
|
28
|
-
def test_cli_with_nonexisting_file
|
29
|
-
with_stabilizer_in_temp_dir do
|
30
|
-
status, o, e = cli("nonexisting.file")
|
31
|
-
assert_equal 1, status
|
32
|
-
assert_match /file does not exist/, e
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
def test_basic_cli
|
37
|
-
with_stabilizer_in_temp_dir do | d |
|
38
|
-
status, o, e = cli("flm.stabilizer")
|
39
|
-
assert_equal 0, status, "Should exit with a normal status (error was #{e})"
|
40
|
-
fs = %w(. ..
|
41
|
-
flm.stabilizer flm_3de_v3.txt flm_3de_v4.txt flm_boujou_text.txt flm_flame.stabilizer
|
42
|
-
flm_matchmover.rz2 flm_mayalive.txt flm_nuke.nk flm_pftrack_2011_pfmatchit.txt flm_pftrack_v4.2dt
|
43
|
-
flm_pftrack_v5.2dt flm_shake_trackers.txt flm_syntheyes_2dt.txt flm_flame_cornerpin.stabilizer
|
44
|
-
flm_tracksperanto_ruby.rb flm_mayaLocators.ma flm_createNulls.jsx flm_xsi_nulls.py flm_nuke_cam_trk_autotracks.txt
|
45
|
-
flm_3dsmax_nulls.ms
|
46
|
-
flm_flamesmoke_2014_cornerpin.stabilizer flm_flamesmoke2014.stabilizer
|
47
|
-
)
|
48
|
-
assert_match /Found and converted 1 trackers with 232 keyframes\./, o, "Should have output coversion statistics"
|
49
|
-
assert_same_set fs, Dir.entries(d)
|
50
|
-
end
|
51
|
-
end
|
52
|
-
|
53
|
-
def test_cli_with_nonexisting_only_exporter_prints_proper_error_message
|
54
|
-
with_stabilizer_in_temp_dir do
|
55
|
-
status, o, e = cli("--only microsoftfuckingword flm.stabilizer")
|
56
|
-
assert_not_equal 0, status, "Should exit with abnormal state"
|
57
|
-
assert e.include?("Unknown exporter \"microsoftfuckingword\"")
|
58
|
-
assert e.include?("The following export modules are available")
|
59
|
-
end
|
60
|
-
end
|
61
|
-
|
62
|
-
def test_cli_with_nonexisting_importer_prints_proper_error_message
|
63
|
-
with_stabilizer_in_temp_dir do
|
64
|
-
status, o, e = cli("--from microsoftfuckingword flm.stabilizer")
|
65
|
-
assert_not_equal 0, status, "Should exit with abnormal state"
|
66
|
-
assert e.include?("Unknown importer \"microsoftfuckingword\"")
|
67
|
-
assert e.include?("The following import modules are available")
|
68
|
-
end
|
69
|
-
end
|
70
|
-
|
71
|
-
def test_cli_with_only_option
|
72
|
-
with_stabilizer_in_temp_dir do | d |
|
73
|
-
cli("#{BIN_P} --only syntheyes flm.stabilizer")
|
74
|
-
fs = %w(. .. flm.stabilizer flm_syntheyes_2dt.txt )
|
75
|
-
assert_same_set fs, Dir.entries(d)
|
76
|
-
end
|
77
|
-
end
|
78
|
-
|
79
|
-
# TODO: This currently hangs in testing
|
80
|
-
# def test_cli_with_trace_option
|
81
|
-
# FileUtils.cp(File.dirname(__FILE__) + "/import/samples/flame_stabilizer/fromCombustion_fromMidClip_wSnap.stabilizer", TEMP_DIR + "/flm.stabilizer")
|
82
|
-
# status, o, e = cli("#{BIN_P} --trace #{TEMP_DIR}/flm.stabilizer")
|
83
|
-
# end
|
84
|
-
|
85
|
-
def test_cli_reformat
|
86
|
-
with_stabilizer_in_temp_dir do | d |
|
87
|
-
cli("--reformat-x 1204 --reformat-y 340 --only flamestabilizer flm.stabilizer")
|
88
|
-
p = Tracksperanto::Import::FlameStabilizer.new(:io => File.open(d + "/flm_flame.stabilizer"))
|
89
|
-
items = p.to_a
|
90
|
-
assert_equal 1204, p.width, "The width of the converted setup should be that"
|
91
|
-
assert_equal 340, p.height, "The height of the converted setup should be that"
|
92
|
-
end
|
93
|
-
end
|
94
|
-
|
95
|
-
def test_cli_trim
|
96
|
-
with_stabilizer_in_temp_dir do | d |
|
97
|
-
results = cli("--slip -8000 --trim --only flamestabilizer flm.stabilizer")
|
98
|
-
assert_not_equal 0, results[0] # status
|
99
|
-
assert_match /There were no trackers exported/, results[-1] # STDERR
|
100
|
-
end
|
101
|
-
end
|
102
|
-
|
103
|
-
# We use this instead of assert_equals for arrays of file names since different filesystems
|
104
|
-
# return files in different order
|
105
|
-
def assert_same_set(expected_enum, enum, message = "Should be the same set")
|
106
|
-
assert_equal Set.new(expected_enum), Set.new(enum), message
|
107
|
-
end
|
108
|
-
end
|