Skip to content

Commit 51338b0

Browse files
committed
CONTRIBUTING: update
1 parent a609e63 commit 51338b0

File tree

1 file changed

+22
-18
lines changed

1 file changed

+22
-18
lines changed

CONTRIBUTING.md

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -33,35 +33,25 @@ There are several ways to contribute to posixutils-rs:
3333
Small, lightweight utility with command line processing,
3434
core algorithm, and zero external crate dependencies.
3535
3. "only std" When an external crate is required, avoid mega-crates. Prefer
36-
std-only, or, tiny crates such as `atty` that perform a single,
36+
std-only, or, tiny crates such as `tempfile` that perform a single,
3737
lightweight function.
3838
4. Correctness, readability, performance, in that order.
3939
Code should be readable by unfamiliar developers. Avoid dense,
4040
uncommented code.
41+
5. Write small functions. Break up large functions.
42+
The compiler can inline as needed.
4143

4244
### Testing, POSIX compliance and programmatic goals
4345

44-
* All utilities should have tests.
45-
* Use plib's TestPlan framework for integration tests.
46-
* Test pattern:
47-
1. Pre-generate input data files.
48-
2. Run system OS utility on input data files,
49-
generating known-good output.
50-
3. Store input and output in-tree, as known-good data.
51-
4. Write a TestPlan that executes our utility, using
52-
static input data, and compares output with
53-
static output data.
54-
* Only "quick" tests should be run automatically in `cargo test`
55-
* Longer tests, or tests requiring root access, should be triggered
56-
via special environment variables.
5746
* POSIX compliance
58-
* Support the most widely used GNU/BSD extensions
59-
* If a system has an OS-specific feature that _must_ be
60-
exposed through a given utility, do so.
61-
* Race-free userland. See `ftw` internal crate.
47+
* Full integration test coverage
48+
* Support widely used GNU/BSD extensions
49+
* Race-free userland. (See `ftw` internal crate.)
6250
* Push small crates out: Create tiny, light-dep crates from common
6351
functionality (such as Lex or Yacc file parsing), and publish via cargo.
6452
Remove from main posixutils tree and set of crates.
53+
* If a system has an OS-specific feature that _must_ be
54+
exposed through a given utility, do so.
6555

6656
### Testing and Bug Reporting: Info to provide in GH issue
6757

@@ -70,3 +60,17 @@ There are several ways to contribute to posixutils-rs:
7060
* Provide any error output from the utility.
7161
* Describe expected results: What did you expect to happen, and did not?
7262

63+
### Writing tests
64+
65+
* Test pattern:
66+
1. Pre-generate input data files.
67+
2. Run system OS utility on input data files,
68+
generating known-good output.
69+
3. Store input and output in-tree, as known-good data.
70+
4. Write a TestPlan that executes our utility, using
71+
static input data, and compares output with
72+
static output data (OS reference data).
73+
* Use plib's TestPlan framework for integration tests.
74+
* Only "quick" tests should be run automatically in `cargo test`
75+
* Longer tests, or tests requiring root access, should be triggered
76+
via special environment variables.

0 commit comments

Comments
 (0)