Skip to content

Instantly share code, notes, and snippets.

@Shuunen
Created June 17, 2018 08:23
Show Gist options
  • Save Shuunen/f858ec0c9af1806d208a327097ff4913 to your computer and use it in GitHub Desktop.
Save Shuunen/f858ec0c9af1806d208a327097ff4913 to your computer and use it in GitHub Desktop.
exiftool-vendored test on Win 7 x86
C:\Users\chou\Downloads\issues\exiftool-vendored.js>yarn
yarn install v1.7.0
[1/5] Validating package.json...
[2/5] Resolving packages...
[3/5] Fetching packages...[#######################################################################################info exiftool-vendored.pl@11.2.0: The platform "win32" is incompatible with this module.
info "exiftool-vendored.pl@11.2.0" is an optional dependency and failed compatibility check. Excluding it from installation.
[4/5] Linking dependencies...
[5/5] Building fresh packages...
Done in 32.22s.
C:\Users\chou\Downloads\issues\exiftool-vendored.js>yarn test
yarn run v1.7.0
$ npm run compile
> exiftool-vendored@5.1.0 precompile C:\Users\chou\Downloads\issues\exiftool-vendored.js
> npm run clean
> exiftool-vendored@5.1.0 clean C:\Users\chou\Downloads\issues\exiftool-vendored.js
> rimraf lib dist coverage .nyc_output
> exiftool-vendored@5.1.0 compile C:\Users\chou\Downloads\issues\exiftool-vendored.js
> tsc
$ nyc mocha --opts .mocha.opts
BinaryExtractionTask
wrote C:\Users\chou\AppData\Local\Temp\tmp-16845WtR638QvfA6
✅ C:\Users\chou\AppData\Local\Temp\tmp-16845WtR638QvfA6 matches expected SHA
√ extracts expected thumb (3085ms)
parser
√ returns success from expected input
√ throws on empty input
√ extracts the expected error message
.millisToFractionalPart()
√ 0 should render .000
√ 1 should render .001
√ 10 should render .010
√ 100 should render .100
√ 12 should render .012
√ 123 should render .123
√ 123.4 should render .1234
√ 123.04 should render .12304
√ 123.004 should render .123004
√ 123.0004 should render .123
√ 123.4567 should render .123457
√ 1234.5678 should render 1.23457
ExifDateTime
example strings with no tz
√ parses year/month/day
√ parses hour/minute/second/millis
√ .toDate() renders a valid Date
√ ISO .toString()s
√ .toISOString() matches .toString()
√ Renders a Date assuming the current timezone offset
example strings with UTC tzoffset
√ parses year/month/day
√ parses hour/minute/second
√ parses tzoffset
√ .toISOString
√ .toISOString() matches .toString()
√ Renders a Date assuming the current timezone offset
√ Renders a UTC Date assuming the current timezone offset
example strings with tz and no millis
√ parses year/month/day
√ parses hour/minute/second
√ parses tzoffset
√ .toISOString
√ .toISOString() matches .toString()
√ Renders a Date assuming the forced timezone offset
√ Renders a UTC Date assuming the current timezone offset
example strings with tz and millis
√ parses year/month/day
√ parses hour/minute/second/millis
√ parses tzoffset
√ .toISOString
√ .toISOString() matches .toString()
√ Renders a Date assuming the forced timezone offset
√ Renders a UTC Date assuming the current timezone offset
ExifTime
√ parses hour/minute/second
√ parses hour/minute/second/millis
√ parses hour/minute/second/micros
ExifTime from GPS
√ hour/minute/second/millis
√ tzoffset
TimeZone
√ extracts timezone from a datetimestamp
√ extracts just offsets
padN
√ pad2(-100) == -100
√ pad3(-100) == -100
√ pad2(-10) == -10
√ pad3(-10) == -10
√ pad2(-1) == -1
√ pad3(-1) == -01
√ pad2(0) == 00
√ pad3(0) == 000
√ pad2(1) == 01
√ pad3(1) == 001
√ pad2(9) == 09
√ pad3(9) == 009
√ pad2(10) == 10
√ pad3(10) == 010
√ pad2(11) == 11
√ pad3(11) == 011
√ pad2(99) == 99
√ pad3(99) == 099
√ pad2(100) == 100
√ pad3(100) == 100
√ pad2(1999) == 1999
√ pad3(1999) == 1999
parsing empty/invalid input
√ 0000:00:00 00:00:00
√ : : : :
ExifTool
√ perl and win32 versions match
√ returns the correct version (1319ms)
√ returns a reasonable value for MaxProcs
√ exports a singleton instance
√ returns expected results for a given file (683ms)
√ returns expected results for a given file with non-english filename
√ Renders Orientation as strings normally
√ Renders Orientation as a number when specified
√ returns warning for a truncated file
√ returns no exif metadata for an image with no headers
√ returns error for missing file
√ sets Error for unsupported file types
√ ends procs when they've run > maxTasksPerProcess (27810ms)
√ ends with multiple procs (4060ms)
Lat/Lon parsing
√ N lat is positive
√ S lat is negative
√ E lon is positive
√ W lon is negative
TimeZone extraction
√ finds positive TimeZone and sets accordingly
√ finds zulu TimeZone and sets accordingly
√ finds negative TimeZone and sets accordingly
√ uses GPSDateTime and DateTimeOriginal and sets accordingly for -7
√ uses GPSDateTime and DateTimeOriginal and sets accordingly for +8
√ renders SubSecDateTimeOriginal for -8
√ skips invalid timestamps
SubSecDateTimeOriginal
√ extracts datetimestamp with millis
RewriteAllTagsTask
√ throws on empty input (2590ms)
√ test file is not problematic (2421ms)
√ problematic file is problematic (2156ms)
√ problematic file is not problematic after rewriting (2765ms)
WriteTask
√ round-trips a comment (1061ms)
√ round-trips a non-latin comment
√ round-trips a comment with non-latin filename
√ round-trips a non-latin comment with non-latin filename
√ round-trips a numeric Orientation
√ round-trips a string Orientation 90 CW
√ round-trips a string Orientation 180 CW
√ updates DateTimeOriginal to a specific time
√ rejects setting to a non-time value (1764ms)
√ rejects a numeric Orientation without -n (4292ms)
√ Accepts a shortcut tag
√ rejects unknown files
√ rejects unknown tags (1775ms)
119 passing (57s)
-------------------------|----------|----------|----------|----------|-------------------|
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s |
-------------------------|----------|----------|----------|----------|-------------------|
All files | 93.35 | 80.43 | 89.25 | 92.4 | |
BinaryExtractionTask.ts | 100 | 83.33 | 100 | 100 | 6 |
DateTime.ts | 98.73 | 95.38 | 93.94 | 98.47 | 137,141 |
ExifTool.ts | 89.87 | 58.82 | 76.19 | 89.19 |... 21,235,292,317 |
ExifToolTask.ts | 100 | 100 | 100 | 100 | |
ReadTask.ts | 84 | 83.02 | 83.33 | 83.1 |... 28,141,151,154 |
RewriteAllTagsTask.ts | 92.31 | 37.5 | 100 | 90.91 | 35 |
Stat.ts | 100 | 100 | 100 | 100 | |
VersionTask.ts | 90.91 | 50 | 100 | 88.89 | 15 |
WriteTask.ts | 93.33 | 75 | 88.89 | 92 | 32,40 |
-------------------------|----------|----------|----------|----------|-------------------|
Done in 80.19s.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment