tracksperanto 1.9.2 → 1.9.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,7 @@
1
1
  require File.dirname(__FILE__) + '/../helper'
2
2
 
3
3
  class NukeImportTest < Test::Unit::TestCase
4
- DELTA = 0.1
4
+ DELTA = 0.01
5
5
 
6
6
  def test_introspects_properly
7
7
  i = Tracksperanto::Import::NukeScript
@@ -9,6 +9,15 @@ class NukeImportTest < Test::Unit::TestCase
9
9
  assert !i.autodetects_size?
10
10
  end
11
11
 
12
+ def test_parsing_big_file_from_nuke
13
+ fixture = File.open(File.dirname(__FILE__) + '/samples/nuke/45trackers.nk')
14
+ parser = Tracksperanto::Import::NukeScript.new
15
+ parser.width = 2048
16
+ parser.height = 1176
17
+ trackers = parser.parse(fixture)
18
+ assert_equal 45, trackers.length
19
+ end
20
+
12
21
  def test_parsing_from_nuke
13
22
  fixture = File.open(File.dirname(__FILE__) + '/samples/nuke/one_tracker_with_break.nk')
14
23
 
data/test/test_cli.rb ADDED
@@ -0,0 +1,76 @@
1
+ require File.dirname(__FILE__) + '/helper'
2
+
3
+ class CliTest < Test::Unit::TestCase
4
+ TEMP_DIR = File.expand_path(File.dirname(__FILE__) + "/tmp")
5
+ BIN_P = File.expand_path(File.dirname(__FILE__) + "/../bin/tracksperanto")
6
+
7
+ def setup
8
+ Dir.mkdir(TEMP_DIR)
9
+ FileUtils.cp(File.dirname(__FILE__) + "/import/samples/flame_stabilizer/fromCombustion_fromMidClip_wSnap.stabilizer", TEMP_DIR + "/flm.stabilizer")
10
+ end
11
+
12
+ def teardown
13
+ FileUtils.rm_rf(TEMP_DIR)
14
+ end
15
+
16
+ # Run the tracksperanto binary with passed options, and return [exit_code, stdout_content, stderr_content]
17
+ def cli(commandline_arguments)
18
+ old_stdout, old_stderr, old_argv = $stdout, $stderr, ARGV.dup
19
+ os, es = StringIO.new, StringIO.new
20
+ begin
21
+ $stdout, $stderr, verbosity = os, es, $VERBOSE
22
+ ARGV.replace(commandline_arguments.split)
23
+ $VERBOSE = false
24
+ load(BIN_P)
25
+ return [0, os.string, es.string]
26
+ rescue Exception => boom # The binary uses exit(), we use that to preserve the output code
27
+ return [boom.status, os.string, es.string] if boom.is_a?(SystemExit)
28
+ raise boom
29
+ ensure
30
+ $VERBOSE = verbosity
31
+ ARGV.replace(old_argv)
32
+ $stdout, $stderr = old_stdout, old_stderr
33
+ end
34
+ end
35
+
36
+ def test_cli_with_no_args_produces_usage
37
+ status, o, e = cli('')
38
+ assert_equal -1, status
39
+ assert_match /Also use the --help option/, e
40
+ end
41
+
42
+ def test_cli_with_nonexisting_file
43
+ status, o, e = cli(TEMP_DIR + "/nonexisting.file")
44
+ assert_equal -1, status
45
+ assert_equal "Input file #{TEMP_DIR + "/nonexisting.file"} does not exist\n", e
46
+ end
47
+
48
+ def test_basic_cli
49
+ status, o, e = cli(TEMP_DIR + "/flm.stabilizer")
50
+ assert_equal 0, status, "Should exit with a normal status"
51
+ fs = %w(. ..
52
+ flm.stabilizer flm_3de_v3.txt flm_3de_v4.txt flm_boujou_text.txt flm_flame.stabilizer
53
+ flm_matchmover.rz2 flm_mayalive.txt flm_nuke.nk flm_pftrack_v4.2dt
54
+ flm_pftrack_v5.2dt flm_shake_trackers.txt flm_syntheyes_2dt.txt
55
+ )
56
+
57
+ assert_equal fs, Dir.entries(TEMP_DIR)
58
+ end
59
+
60
+ def test_cli_with_only_option
61
+ FileUtils.cp(File.dirname(__FILE__) + "/import/samples/flame_stabilizer/fromCombustion_fromMidClip_wSnap.stabilizer", TEMP_DIR + "/flm.stabilizer")
62
+ cli("#{BIN_P} --only syntheyes #{TEMP_DIR}/flm.stabilizer")
63
+ fs = %w(. .. flm.stabilizer flm_syntheyes_2dt.txt )
64
+ assert_equal fs, Dir.entries(TEMP_DIR)
65
+ end
66
+
67
+ def test_cli_reformat
68
+ FileUtils.cp(File.dirname(__FILE__) + "/import/samples/flame_stabilizer/fromCombustion_fromMidClip_wSnap.stabilizer", TEMP_DIR + "/flm.stabilizer")
69
+ cli("--reformat-x 1204 --reformat-y 340 --only flamestabilizer #{TEMP_DIR}/flm.stabilizer")
70
+
71
+ p = Tracksperanto::Import::FlameStabilizer.new
72
+ f = p.parse(File.open(TEMP_DIR + "/flm_flame.stabilizer"))
73
+ assert_equal 1204, p.width, "The width of the converted setup should be that"
74
+ assert_equal 340, p.height, "The height of the converted setup should be that"
75
+ end
76
+ end
@@ -57,7 +57,7 @@ class PipelineTest < Test::Unit::TestCase
57
57
  FileUtils.cp("./import/samples/shake_script/four_tracks_in_one_stabilizer.shk", "./input.shk")
58
58
  pipeline = Tracksperanto::Pipeline::Base.new
59
59
  assert_nothing_raised { pipeline.run("./input.shk", :importer => "Syntheyes", :width => 720, :height => 576) }
60
- assert_equal 11, Dir.glob("./input*").length, "Eleven files should be present for the input and outputs"
60
+ assert_equal 12, Dir.glob("./input*").length, "Twelve files should be present for the input and outputs"
61
61
  end
62
62
 
63
63
  def test_run_with_overridden_importer_and_size_for_file_that_would_be_recognized_differently
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tracksperanto
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.2
4
+ version: 1.9.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Julik Tarkhanov
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-04-02 00:00:00 +02:00
12
+ date: 2010-04-15 00:00:00 +02:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -40,7 +40,7 @@ dependencies:
40
40
  requirements:
41
41
  - - ">="
42
42
  - !ruby/object:Gem::Version
43
- version: 2.3.3
43
+ version: 2.6.0
44
44
  version:
45
45
  description: Tracksperanto is a universal 2D-track translator between many apps.
46
46
  email:
@@ -62,6 +62,7 @@ files:
62
62
  - Rakefile
63
63
  - bin/tracksperanto
64
64
  - lib/export/base.rb
65
+ - lib/export/boujou.rb
65
66
  - lib/export/equalizer3.rb
66
67
  - lib/export/equalizer4.rb
67
68
  - lib/export/flame_stabilizer.rb
@@ -121,10 +122,12 @@ files:
121
122
  - test/export/samples/ref_PFTrack5.2dt
122
123
  - test/export/samples/ref_ShakeText.txt
123
124
  - test/export/samples/ref_Syntheyes.txt
125
+ - test/export/samples/ref_boujou.txt
124
126
  - test/export/samples/ref_equalizer.txt
125
127
  - test/export/samples/ref_equalizer3.txt
126
128
  - test/export/samples/ref_flame.stabilizer
127
129
  - test/export/samples/ref_matchmover.rz2
130
+ - test/export/test_boujou_export.rb
128
131
  - test/export/test_equalizer3_export.rb
129
132
  - test/export/test_equalizer_export.rb
130
133
  - test/export/test_flame_stabilizer_export.rb
@@ -147,6 +150,7 @@ files:
147
150
  - test/import/samples/match_mover/kipPointsMatchmover.rz2
148
151
  - test/import/samples/mayalive/mayalive_kipShot.txt
149
152
  - test/import/samples/nuke/018.nk
153
+ - test/import/samples/nuke/45trackers.nk
150
154
  - test/import/samples/nuke/one_tracker_with_break.nk
151
155
  - test/import/samples/nuke/one_tracker_with_break_in_grp.nk
152
156
  - test/import/samples/nuke/tracker_with_differing_gaps.nk
@@ -192,6 +196,7 @@ files:
192
196
  - test/middleware/test_shift_middleware.rb
193
197
  - test/middleware/test_slip_middleware.rb
194
198
  - test/test_buffer_io.rb
199
+ - test/test_cli.rb
195
200
  - test/test_const_name.rb
196
201
  - test/test_extio.rb
197
202
  - test/test_flame_builder.rb
@@ -232,6 +237,7 @@ signing_key:
232
237
  specification_version: 3
233
238
  summary: Tracksperanto is a universal 2D-track translator between many apps.
234
239
  test_files:
240
+ - test/export/test_boujou_export.rb
235
241
  - test/export/test_equalizer3_export.rb
236
242
  - test/export/test_equalizer_export.rb
237
243
  - test/export/test_flame_stabilizer_export.rb
@@ -265,6 +271,7 @@ test_files:
265
271
  - test/middleware/test_shift_middleware.rb
266
272
  - test/middleware/test_slip_middleware.rb
267
273
  - test/test_buffer_io.rb
274
+ - test/test_cli.rb
268
275
  - test/test_const_name.rb
269
276
  - test/test_extio.rb
270
277
  - test/test_flame_builder.rb