indexedlog: move binary indexedlog_dump out

Summary:
It makes testing duplicated - now `cargo test` would try running tests on 2 entry points:
lib.rs and indexedlog_dump.rs.  Move it to a separate crate to solve the issue.

Reviewed By: markbt

Differential Revision: D13498266

fbshipit-source-id: 8abf07c1272dfa825ec7701fd8ea9e0d1310ec5f
This commit is contained in:
Jun Wu 2018-12-18 08:11:31 -08:00 committed by Facebook Github Bot
parent ce243170da
commit 443a8f33b3
4 changed files with 10 additions and 19 deletions

6
exec/utils/Cargo.toml Normal file
View File

@ -0,0 +1,6 @@
[package]
name = "utils"
version = "0.1.0"
[dependencies]
indexedlog = { path = "../../lib/indexedlog" }

View File

@ -11,20 +11,7 @@
// Write code paths are not used.
#![allow(dead_code)]
extern crate atomicwrites;
extern crate byteorder;
extern crate fs2;
extern crate memmap;
extern crate twox_hash;
extern crate vlqencoding;
mod base16;
mod checksum_table;
mod index;
mod lock;
mod log;
mod utils;
extern crate indexedlog;
use std::{env, path::Path};
fn main() {
@ -32,11 +19,11 @@ fn main() {
let path = Path::new(&arg);
if path.is_dir() {
// Treate it as Log.
let log = log::Log::open(path, Vec::new()).unwrap();
let log = indexedlog::log::Log::open(path, Vec::new()).unwrap();
println!("Log Directory {:?}:\n{:#?}\n", path, log);
} else if path.is_file() {
// Treate it as Index.
let idx = index::OpenOptions::new().open(path).unwrap();
let idx = indexedlog::index::OpenOptions::new().open(path).unwrap();
println!("Index File {:?}\n{:?}\n", path, idx);
} else {
println!(

View File

@ -28,6 +28,3 @@ harness = false
name = "log"
harness = false
[[bin]]
name = "indexedlog-dump"
path = "src/indexedlog_dump.rs"

View File

@ -2075,6 +2075,7 @@ rustextbinaries = [
rename="hg.rust",
features=hgmainfeatures,
),
RustBinary("indexedlog_dump", manifest="exec/utils/Cargo.toml"),
]
setup(