This repository hosts the darktable
integration tests. Each test renders a raw image from images/ through a
fixed XMP sidecar with darktable-cli and compares the result against a
committed reference image, both on the CPU and the OpenCL path.
run : main driver, runs the tests
deltae : CIE 2000 delta-E report between two images (C helper,
built from deltae.c by ./run)
count-diff-pixels : number of differing pixels between two images (C helper,
built from count-diff-pixels.c by ./run)
check-performance : reports timing regressions from logs/perfs.log
check-failures : interactive review of the failures of a log
check-cpu-gpu : refreshes the cpugpu.maxpix thresholds from a log
src/ : source code for helper scripts
images/ : test images
logs/ : run logs, timings (perfs.log) and their analysis
nnnn-name/ : one test
A test directory contains:
| file | |
|---|---|
<name>.xmp |
the sidecar to apply, names the image via DerivedFrom |
<name>.dtdata |
optional, .dtdata sidecar placed next to the image for the run |
expected.png |
the reference output, created on the first run |
cpugpu.maxpix |
max tolerated CPU/GPU pixel difference |
CONFIG |
optional, one extra darktable-cli conf option per line |
README |
optional, first line is a label shown next to the test |
test.sh |
optional, replaces the default driver, returns 0 if OK |
A test passes when the max delta-E against expected.png stays below 2.3
(and the average below 2.3/3).
darktable-cli, found either in thePATH, through theDARKTABLE_CLIenvironment variable, or in/opt/darktablecompare(ImageMagick), for the diff imageszopflipng, only needed to create theexpected.pngof a new testloupe, only needed bycheck-failures- a C compiler and
libpng(pkg-config modulelibpng), to build the Cdeltaeandcount-diff-pixels. Both are built multithreaded when the compiler supports OpenMP, which makes them noticeably faster on large images; a compiler without OpenMP builds them single-threaded
./run # all tests
./run 0001-exposure # a single test
./run --op=exposure # all tests using that moduleOptions:
--disable-opencl do not run the OpenCL path
--disable-timing do not output timing
--no-deltae light check, does not need the delta-E module
--fast-fail stop on the first failing test
--op=<n> | --operation=<n> run the tests with matching operation n
--gdb | --gdb-cl run the CPU / OpenCL path under gdb
Every run writes logs/test-<date>.log, appends the timings to
logs/perfs.log and finally reports timing regressions. To review the
failures of a run:
./check-failures logs/test-<date>.log- Create the directory
<nnnn>-<meaningful name>. - Develop one of the test images in darktable, then copy its XMP into that
directory as
<meaningful name>.xmp. - Optionally add a
README, aCONFIGand a<meaningful name>.dtdata(see the table above). - Run
./run <dir>a first time: as there is noexpected.pngyet, the output is optimized withzopflipngand saved as the reference. Check that it really is the expected output. - Run
./run <dir>again, everything must now be 0:
Test 0001-exposure
Image mire1.cr2
CPU & GPU version differ by 25699 pixels
----------------------------------
Max dE : 0.00000
Avg dE : 0.00000
Std dE : 0.00000
----------------------------------
...
Pixels above tolerance : 0.00 %
OK
- Commit the
.xmpand theexpected.png.
Create <nnnn>-<meaningful name>/test.sh instead. It may do whatever the
test needs and must return 0 when the test passes, 1 otherwise.