-
Notifications
You must be signed in to change notification settings - Fork 0
/
ddmin.1
58 lines (48 loc) · 857 Bytes
/
ddmin.1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.Dd $Mdocdate: March 8 2017 $
.Dt DDMIN 1
.Os
.Sh NAME
.Nm ddmin
.Nd minimise interesting files automatically
.Sh SYNOPSIS
.Nm ddmin
.Op Fl b
.Op Fl h
.Ar tester
.Ar interesting
.Sh DESCRIPTION
.Nm
minimises file
.Ar interesting
in place using delta debugging.
It works by deleting lines (or bytes with -b) while ensuring
.Ar tester
returns 0 when executed.
.Pp
.Nm
forwards the stdout and stderr of successive
.Ar tester
executions to enable debug logging.
.Sh EXIT STATUS
.Ex -std ddmin
.Sh EXAMPLE
.Bd -literal
Given the input file interesting.c:
#include <stdio.h>
int main()
{
printf("hello world!");
return 0;
}
The test script test.sh:
#! /bin/sh
set -e
gcc interesting.c
if ! ./a.out | grep -q "hello" then
exit 1
fi
The invocation:
ddmin -b ./test.sh ./interesting.c
Produces the minimised output:
main(){printf("hello");return;}
.Ed