Skip to content

Commit e5a2cc8

Browse files
committed
Use cargo virtual workspace
Signed-off-by: Sean Young <[email protected]>
1 parent 4c97233 commit e5a2cc8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+97
-95
lines changed

Diff for: Cargo.toml

+12-43
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,20 @@
1-
[package]
2-
name = "cir"
3-
version = "0.1.3"
4-
authors = ["Sean Young <[email protected]>"]
5-
repository = "https://github.com/seanyoung/cir"
6-
edition = "2021"
7-
description = "Linux Infrared Tooling"
8-
license = "MIT"
9-
rust-version = "1.74.0"
10-
exclude = [ "/.git*", "/testdata", "/tests", "/TODO" ]
11-
12-
[dependencies]
13-
clap = { version = "4.5", features = [ "derive" ] }
14-
toml = "0.8"
15-
itertools = "0.12"
16-
bitflags = "2.5"
17-
num-integer = "0.1"
18-
terminal_size = "0.3"
19-
log = "0.4"
20-
peg = "0.8"
21-
22-
[target.'cfg(target_os = "linux")'.dependencies]
23-
evdev = { git = "https://github.com/emberian/evdev" }
24-
nix = { version = "0.28", features = [ "fs", "ioctl", "poll" ] }
25-
aya = { git = "https://github.com/aya-rs/aya.git" }
26-
irp = { version = "0.3.3", path = "irp", features = [ "bpf" ] }
27-
28-
[target.'cfg(not(target_os = "linux"))'.dependencies]
29-
irp = { version = "0.3.3", path = "irp" }
30-
31-
[dev-dependencies]
32-
assert_cmd = "2.0"
33-
serde_json = "1.0"
34-
liblircd = { path = "tests/liblircd" }
35-
libirctl = { path = "tests/libirctl" }
36-
rand = "0.8"
37-
381
[workspace]
392
members = [
403
"irp",
41-
"tests/liblircd",
42-
"tests/libirctl",
43-
"irp/tests/rust-irptransmogrifier",
4+
"cir",
5+
"transmogrifier_compare",
6+
"lirc_compare",
7+
]
8+
default-members = [
9+
"irp",
10+
"cir",
4411
]
12+
resolver = "2"
4513

46-
[features]
47-
default = []
48-
loopback-tests = []
14+
[workspace.dependencies]
15+
libirctl = { path = "libirctl" }
16+
liblircd = { path = "liblircd" }
17+
irptransmogrifier = { path = "rust-irptransmogrifier" }
4918

5019
[profile.release]
5120
lto = true

Diff for: cir/Cargo.toml

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
[package]
2+
name = "cir"
3+
version = "0.1.3"
4+
authors = ["Sean Young <[email protected]>"]
5+
repository = "https://github.com/seanyoung/cir"
6+
edition = "2021"
7+
description = "Linux Infrared Tooling"
8+
license = "MIT"
9+
rust-version = "1.74.0"
10+
exclude = [ "/tests" ]
11+
12+
[dependencies]
13+
clap = { version = "4.5", features = [ "derive" ] }
14+
toml = "0.8"
15+
itertools = "0.12"
16+
bitflags = "2.5"
17+
num-integer = "0.1"
18+
terminal_size = "0.3"
19+
log = "0.4"
20+
peg = "0.8"
21+
22+
[target.'cfg(target_os = "linux")'.dependencies]
23+
evdev = { git = "https://github.com/emberian/evdev" }
24+
nix = { version = "0.28", features = [ "fs", "ioctl", "poll" ] }
25+
aya = { git = "https://github.com/aya-rs/aya.git" }
26+
irp = { version = "0.3.3", path = "../irp", features = [ "bpf" ] }
27+
28+
[target.'cfg(not(target_os = "linux"))'.dependencies]
29+
irp = { version = "0.3.3", path = "../irp" }
30+
31+
[dev-dependencies]
32+
assert_cmd = "2.0"
33+
serde_json = "1.0"
34+
liblircd = { workspace = true }
35+
libirctl = { workspace = true }
36+
rand = "0.8"

Diff for: src/bin/cir.rs renamed to cir/src/bin/cir.rs

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

Diff for: src/lib.rs renamed to cir/src/lib.rs

File renamed without changes.

Diff for: src/lirc.rs renamed to cir/src/lirc.rs

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

Diff for: src/rc_maps.rs renamed to cir/src/rc_maps.rs

File renamed without changes.

Diff for: src/rcdev.rs renamed to cir/src/rcdev.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -230,17 +230,17 @@ mod tests {
230230

231231
#[test]
232232
fn parse_bad() {
233-
let e = parse_rc_maps_file(&PathBuf::from("testdata/rc_maps_cfg/bad.cfg")).unwrap_err();
233+
let e = parse_rc_maps_file(&PathBuf::from("../testdata/rc_maps_cfg/bad.cfg")).unwrap_err();
234234

235235
assert_eq!(
236236
format!("{e}"),
237-
"testdata/rc_maps_cfg/bad.cfg:4: error: invalid parameters"
237+
"../testdata/rc_maps_cfg/bad.cfg:4: error: invalid parameters"
238238
);
239239
}
240240

241241
#[test]
242242
fn parse_good() {
243-
let t = parse_rc_maps_file(&PathBuf::from("testdata/rc_maps_cfg/ttusbir.cfg")).unwrap();
243+
let t = parse_rc_maps_file(&PathBuf::from("../testdata/rc_maps_cfg/ttusbir.cfg")).unwrap();
244244

245245
assert_eq!(t.len(), 2);
246246

Diff for: tests/decode_tests.rs renamed to cir/tests/decode_tests.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ fn toggle_bit_mask() {
66

77
let assert = cmd
88
.args([
9-
"decode", "keymap", "testdata/lircd_conf/d-link/DSM-10.lircd.conf", "-q", "-r",
9+
"decode", "keymap", "../testdata/lircd_conf/d-link/DSM-10.lircd.conf", "-q", "-r",
1010
"+9132 -4396 +664 -460 +664 -460 +664 -460 +664 -1592 +664 -460 +664 -460 +664 -460 +664 -460 +664 -460 +664 -1592 +664 -1592 +664 -460 +664 -460 +664 -1592 +664 -1592 +664 -1592 +664 -460 +664 -460 +664 -1592 +664 -460 +664 -1592 +664 -460 +664 -460 +664 -460 +664 -1592 +664 -1592 +664 -460 +664 -1592 +664 -460 +664 -1592 +664 -1592 +664 -1592 +671 -42232 +9128 -2143 +671 -96305"
1111
])
1212
.assert();
@@ -33,7 +33,7 @@ fn ignore_mask() {
3333

3434
let assert = cmd
3535
.args([
36-
"decode", "keymap", "testdata/lircd_conf/apple/A1156.lircd.conf", "-q", "-r",
36+
"decode", "keymap", "../testdata/lircd_conf/apple/A1156.lircd.conf", "-q", "-r",
3737
"+9065 -4484 +574 -547 +574 -1668 +574 -1668 +574 -1668 +574 -547 +574 -1668 +574 -1668 +574 -1668 +574 -1668 +574 -1668 +574 -1668 +574 -547 +574 -547 +574 -547 +574 -547 +574 -1668 +574 -547 +574 -1668 +574 -1668 +574 -547 +574 -547 +574 -547 +574 -547 +574 -547 +574 -1668 +574 -1668 +574 -547 +574 -547 +574 -547 +574 -1668 +574 -547 +574 -1668 +567 -37600 +9031 -2242 +567 -37600"
3838
])
3939
.assert();
@@ -56,7 +56,7 @@ decoded: remote:Apple_A1156 code:KEY_PLAY
5656

5757
let assert = cmd
5858
.args([
59-
"decode", "keymap", "testdata/lircd_conf/apple/A1156.lircd.conf", "-q", "-r",
59+
"decode", "keymap", "../testdata/lircd_conf/apple/A1156.lircd.conf", "-q", "-r",
6060
"+9065 -4484 +574 -547 +574 -1668 +574 -1668 +574 -1668 +574 -547 +574 -1668 +574 -1668 +574 -1668 +574 -1668 +574 -1668 +574 -1668 +574 -547 +574 -547 +574 -547 +574 -547 +574 -1668 +574 -547 +574 -1668 +574 -1668 +574 -547 +574 -547 +574 -547 +574 -547 +574 -547 +574 -547 +574 -547 +574 -1668 +574 -1668 +574 -1668 +574 -547 +574 -1668 +574 -547 +567 -37600 +9031 -2242 +567 -37600"
6161
])
6262
.assert();
@@ -82,7 +82,7 @@ fn keymap() {
8282

8383
let assert = cmd
8484
.args([
85-
"decode", "keymap", "testdata/rc_keymaps/sony.toml", "-v", "-r",
85+
"decode", "keymap", "../testdata/rc_keymaps/sony.toml", "-v", "-r",
8686
"+2400 -600 +600 -600 +600 -600 +600 -600 +600 -600 +600 -600 +1200 -600 +1200 -600 +600 -600 +600 -600 +600 -600 +600 -600 +1200 -26400"
8787
])
8888
.assert();
@@ -111,7 +111,7 @@ info: decoding: +2400 -600 +600 -600 +600 -600 +600 -600 +600 -600 +600 -600 +12
111111

112112
let assert = cmd
113113
.args([
114-
"decode", "keymap", "testdata/rc_keymaps/dish_network.toml", "-q", "-r",
114+
"decode", "keymap", "../testdata/rc_keymaps/dish_network.toml", "-q", "-r",
115115
"+525 -6045 +440 -2780 +440 -2780 +440 -2780 +440 -2780 +440 -1645 +440 -2780 +440 -2780 +440 -2780 +440 -2780 +440 -2780 +440 -2780 +440 -2780 +440 -2780 +440 -2780 +440 -2780 +440 -2780 +450 -40000"
116116
])
117117
.assert();
@@ -133,7 +133,7 @@ info: decoding: +2400 -600 +600 -600 +600 -600 +600 -600 +600 -600 +600 -600 +12
133133

134134
let assert = cmd
135135
.args([
136-
"decode", "keymap", "testdata/rc_keymaps/rc6_mce.toml", "-q", "-r",
136+
"decode", "keymap", "../testdata/rc_keymaps/rc6_mce.toml", "-q", "-r",
137137
"+2664 -888 +444 -444 +444 -444 +444 -888 +444 -888 +1332 -888 +444 -444 +444 -444 +444 -444 +444 -444 +444 -444 +444 -444 +444 -444 +444 -444 +444 -444 +444 -444 +888 -444 +444 -444 +444 -444 +444 -888 +444 -444 +444 -444 +444 -444 +444 -444 +888 -888 +444 -444 +444 -444 +888 -888 +888 -444 +444 -444 +444 -888 +444 -444 +444 -67704"
138138
])
139139
.assert();
@@ -155,7 +155,7 @@ info: decoding: +2400 -600 +600 -600 +600 -600 +600 -600 +600 -600 +600 -600 +12
155155

156156
let assert = cmd
157157
.args([
158-
"decode", "keymap", "testdata/rc_keymaps/RM-786.toml", "-r",
158+
"decode", "keymap", "../testdata/rc_keymaps/RM-786.toml", "-r",
159159
"+2465 -569 +620 -582 +618 -584 +1242 -581 +618 -585 +620 -583 +620 -585 +1242 -607 +622 -575 +1243 -584 +1243 -578 +621 -579 +619 -20000"
160160
])
161161
.assert();

Diff for: tests/encode_tests.rs renamed to cir/tests/encode_tests.rs

+10-10
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ fn encode_lircd_raw_test() {
3838
"transmit",
3939
"--dry-run",
4040
"keymap",
41-
"testdata/lircd_conf/pace/DC420N.lircd.conf",
41+
"../testdata/lircd_conf/pace/DC420N.lircd.conf",
4242
"1",
4343
])
4444
.assert();
@@ -68,7 +68,7 @@ fn encode_lircd_aiwa_test() {
6868
"transmit",
6969
"--dry-run",
7070
"keymap",
71-
"testdata/lircd_conf/aiwa/RC-5VP05.lircd.conf",
71+
"../testdata/lircd_conf/aiwa/RC-5VP05.lircd.conf",
7272
"AUTO",
7373
])
7474
.assert();
@@ -124,15 +124,15 @@ fn encode_rawir_test() {
124124
"--dry-run",
125125
"rawir",
126126
"-f",
127-
"testdata/rawir/mode2",
127+
"../testdata/rawir/mode2",
128128
"345",
129129
"-g",
130130
"30000",
131131
"+123 40 124",
132132
"-g",
133133
"40000",
134134
"-f",
135-
"testdata/rawir/rawir",
135+
"../testdata/rawir/rawir",
136136
])
137137
.assert();
138138

@@ -159,7 +159,7 @@ fn encode_lircd_grundig_test() {
159159
"transmit",
160160
"--dry-run",
161161
"keymap",
162-
"testdata/lircd_conf/grundig/RP75_LCD.lircd.conf",
162+
"../testdata/lircd_conf/grundig/RP75_LCD.lircd.conf",
163163
"-m",
164164
"grundig_rp75",
165165
"0",
@@ -190,7 +190,7 @@ fn empty_lircd_conf() {
190190
"transmit",
191191
"--dry-run",
192192
"keymap",
193-
"testdata/lircd_conf/empty",
193+
"../testdata/lircd_conf/empty",
194194
])
195195
.assert();
196196

@@ -203,7 +203,7 @@ fn empty_lircd_conf() {
203203

204204
assert_eq!(
205205
stderr,
206-
r#"error: testdata/lircd_conf/empty: parse error at error at 1:3: expected "table"
206+
r#"error: ../testdata/lircd_conf/empty: parse error at error at 1:3: expected "table"
207207
"#
208208
);
209209
}
@@ -218,7 +218,7 @@ fn keymaps() {
218218
"--dry-run",
219219
"-v",
220220
"keymap",
221-
"testdata/rc_keymaps/RM-687C.toml",
221+
"../testdata/rc_keymaps/RM-687C.toml",
222222
"KEY_0",
223223
])
224224
.assert();
@@ -245,7 +245,7 @@ info: rawir: +2369 -637 +1166 -637 +565 -637 +565 -637 +1166 -637 +565 -637 +565
245245
"transmit",
246246
"--dry-run",
247247
"keymap",
248-
"testdata/rc_keymaps/RM-786.toml",
248+
"../testdata/rc_keymaps/RM-786.toml",
249249
"KEY_CABLEFWD",
250250
])
251251
.assert();
@@ -320,7 +320,7 @@ info: rawir: +2369 -637 +1166 -637 +565 -637 +565 -637 +1166 -637 +565 -637 +565
320320
"transmit",
321321
"--dry-run",
322322
"keymap",
323-
"testdata/rc_keymaps/rc6_mce.toml",
323+
"../testdata/rc_keymaps/rc6_mce.toml",
324324
"KEY_ENTER",
325325
"-v",
326326
])

Diff for: tests/irctl_encode.rs renamed to cir/tests/irctl_encode.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ fn irctl_compare_encode(path: &Path, scancode: u32, our_keymap: &Keymap) {
5555

5656
#[test]
5757
fn keymap_encode() {
58-
recurse(Path::new("testdata/rc_keymaps"));
58+
recurse(Path::new("../testdata/rc_keymaps"));
5959
}
6060

6161
fn recurse(path: &Path) {

Diff for: tests/lircd_conf_tests.rs renamed to cir/tests/lircd_conf_tests.rs

+7-6
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use std::{
1010

1111
#[test]
1212
fn lircd_testdata() {
13-
recurse(&PathBuf::from("testdata/lircd_conf"));
13+
recurse(&PathBuf::from("../testdata/lircd_conf"));
1414
}
1515

1616
fn recurse(path: &Path) {
@@ -164,19 +164,20 @@ fn lircd_encode_decode(path: &Path) {
164164

165165
// let's see if lircd can decode its own creation
166166

167-
if path == OsStr::new("testdata/lircd_conf/creative/livedrive.lircd.conf") {
167+
if path == OsStr::new("../testdata/lircd_conf/creative/livedrive.lircd.conf") {
168168
// not decodable, missing ptrail
169169
continue;
170170
}
171171

172-
if path == OsStr::new("testdata/lircd_conf/meridian/MSR.lircd.conf") {
172+
if path == OsStr::new("../testdata/lircd_conf/meridian/MSR.lircd.conf") {
173173
// not decodable, missing plead/header
174174
continue;
175175
}
176176

177-
if path == OsStr::new("testdata/lircd_conf/logitech/logitech.lircd.conf")
178-
|| path == OsStr::new("testdata/lircd_conf/pcmak/pcmak.lircd.conf")
179-
|| path == OsStr::new("testdata/lircd_conf/pixelview/remotemaster.lircd.conf")
177+
if path == OsStr::new("../testdata/lircd_conf/logitech/logitech.lircd.conf")
178+
|| path == OsStr::new("../testdata/lircd_conf/pcmak/pcmak.lircd.conf")
179+
|| path
180+
== OsStr::new("../testdata/lircd_conf/pixelview/remotemaster.lircd.conf")
180181
{
181182
// not decodable, leading space (both lircd and irp crate)
182183
continue;

Diff for: irp/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ inkwell = { version = "0.4", features = [ "target-bpf", "llvm15-0-force-dynamic"
2727
bpf = [ "inkwell" ]
2828

2929
[dev-dependencies]
30-
cir = { path = ".." }
30+
cir = { path = "../cir" }
3131
rand = "0.8"
32-
irptransmogrifier = { path = "tests/rust-irptransmogrifier" }
32+
irptransmogrifier = { workspace = true }
3333
aya-obj = { version = "0.1", features = [ "std" ] }
3434
rbpf = "0.2"

Diff for: irp/tests/encoder_fuzzer/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ publish = false
77
[dependencies]
88
afl = "*"
99
irp = { path = "../.." }
10-
irptransmogrifier = { path = "../rust-irptransmogrifier" }
10+
irptransmogrifier = { path = "../../../rust-irptransmogrifier" }
1111
rand = "0.8"
1212

1313
[workspace]
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

Diff for: tests/liblircd/tests/transmit.rs renamed to liblircd/tests/transmit.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use std::fs::read_to_string;
33

44
#[test]
55
fn encode() {
6-
let conf = read_to_string("../../testdata/lircd_conf/thomson/ROC740.lircd.conf").unwrap();
6+
let conf = read_to_string("../testdata/lircd_conf/thomson/ROC740.lircd.conf").unwrap();
77

88
//unsafe { lirc_log_set_stdout() };
99

@@ -37,7 +37,7 @@ fn encode() {
3737
}
3838
}
3939

40-
let conf = read_to_string("../../testdata/lircd_conf/motorola/DCH3200.lircd.conf").unwrap();
40+
let conf = read_to_string("../testdata/lircd_conf/motorola/DCH3200.lircd.conf").unwrap();
4141

4242
// unsafe { lirc_log_set_stdout() };
4343

@@ -70,7 +70,7 @@ fn encode() {
7070
}
7171
}
7272

73-
let conf = read_to_string("../../testdata/lircd_conf/motorola/QIP2500.lircd.conf").unwrap();
73+
let conf = read_to_string("../testdata/lircd_conf/motorola/QIP2500.lircd.conf").unwrap();
7474

7575
let conf = LircdConf::parse(&conf).unwrap();
7676

@@ -110,7 +110,7 @@ fn encode() {
110110

111111
// now test decode of a remote with toggle_bit_mask set (more than one bit)
112112

113-
let conf = read_to_string("../../testdata/lircd_conf/d-link/DSM-10.lircd.conf").unwrap();
113+
let conf = read_to_string("../testdata/lircd_conf/d-link/DSM-10.lircd.conf").unwrap();
114114

115115
//unsafe { lirc_log_set_stdout() };
116116

@@ -163,7 +163,7 @@ fn encode() {
163163

164164
// now test decoder of a remote with an ignore_mask
165165

166-
let conf = read_to_string("../../testdata/lircd_conf/apple/A1156.lircd.conf").unwrap();
166+
let conf = read_to_string("../testdata/lircd_conf/apple/A1156.lircd.conf").unwrap();
167167

168168
//unsafe { lirc_log_set_stdout() };
169169

File renamed without changes.

Diff for: lirc_compare/Cargo.toml

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[package]
2+
name = "lirc_compare"
3+
version = "0.1.0"
4+
edition = "2021"
5+
6+
[dependencies]
7+
cir = { path = "../cir" }
8+
irp = { path = "../irp" }
9+
liblircd = { workspace = true }
10+
num-integer = "0.1"
File renamed without changes.

0 commit comments

Comments
 (0)