Mercurial > crates > nonstick
annotate testharness/src/lib.rs @ 116:a12706e42c9d default tip
Logging, macros, and building:
- Changes logging API to accept the `Location` of the log statement.
Fixes OpenPAM implementation.
- Stops publicly exporting doc macros.
- Uses dlopen to detect the PAM library rather than header jankery.
author | Paul Fisher <paul@pfish.zone> |
---|---|
date | Sun, 29 Jun 2025 18:27:51 -0400 |
parents | a2676475e86b |
children |
rev | line source |
---|---|
104
a2676475e86b
Create the very start of a test suite.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
1 //! The nonstick library |
a2676475e86b
Create the very start of a test suite.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
2 extern crate nonstick; |
a2676475e86b
Create the very start of a test suite.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
3 |
a2676475e86b
Create the very start of a test suite.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
4 use nonstick::{pam_hooks, Flags, PamHandleModule, PamModule}; |
a2676475e86b
Create the very start of a test suite.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
5 use std::ffi::CStr; |
a2676475e86b
Create the very start of a test suite.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
6 |
a2676475e86b
Create the very start of a test suite.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
7 struct TestHarness; |
a2676475e86b
Create the very start of a test suite.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
8 |
a2676475e86b
Create the very start of a test suite.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
9 impl<M: PamHandleModule> PamModule<M> for TestHarness { |
a2676475e86b
Create the very start of a test suite.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
10 fn authenticate(handle: &mut M, args: Vec<&CStr>, flags: Flags) -> nonstick::Result<()> { |
a2676475e86b
Create the very start of a test suite.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
11 Ok(()) |
a2676475e86b
Create the very start of a test suite.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
12 } |
a2676475e86b
Create the very start of a test suite.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
13 |
a2676475e86b
Create the very start of a test suite.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
14 fn account_management(handle: &mut M, args: Vec<&CStr>, flags: Flags) -> nonstick::Result<()> { |
a2676475e86b
Create the very start of a test suite.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
15 Ok(()) |
a2676475e86b
Create the very start of a test suite.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
16 } |
a2676475e86b
Create the very start of a test suite.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
17 } |
a2676475e86b
Create the very start of a test suite.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
18 |
a2676475e86b
Create the very start of a test suite.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
19 pam_hooks!(TestHarness); |