mirror of
https://github.com/supleed2/sv-filelist-parser.git
synced 2024-12-22 21:35:49 +00:00
Change package name to verilog filelist parser and remove main.rs
This commit is contained in:
parent
f8e5601803
commit
80f5fd6879
14
Cargo.lock
generated
14
Cargo.lock
generated
|
@ -34,13 +34,6 @@ name = "regex-syntax"
|
||||||
version = "0.6.13"
|
version = "0.6.13"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "sv-filelist-parser"
|
|
||||||
version = "0.1.0"
|
|
||||||
dependencies = [
|
|
||||||
"regex 1.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "thread_local"
|
name = "thread_local"
|
||||||
version = "1.0.1"
|
version = "1.0.1"
|
||||||
|
@ -49,6 +42,13 @@ dependencies = [
|
||||||
"lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "verilog-filelist-parser"
|
||||||
|
version = "0.1.0"
|
||||||
|
dependencies = [
|
||||||
|
"regex 1.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
]
|
||||||
|
|
||||||
[metadata]
|
[metadata]
|
||||||
"checksum aho-corasick 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)" = "58fb5e95d83b38284460a5fda7d6470aa0b8844d283a0b614b8535e880800d2d"
|
"checksum aho-corasick 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)" = "58fb5e95d83b38284460a5fda7d6470aa0b8844d283a0b614b8535e880800d2d"
|
||||||
"checksum lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
|
"checksum lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
[package]
|
[package]
|
||||||
name = "sv-filelist-parser"
|
name = "verilog-filelist-parser"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
authors = ["Raamakrishnan <raamakrishnan1997@gmail.com>"]
|
authors = ["Raamakrishnan <raamakrishnan1997@gmail.com>"]
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
# sv-filelist-parser
|
# verilog-filelist-parser
|
||||||
|
|
||||||
A Verilog Filelist parser in Rust
|
A Verilog Filelist parser in Rust
|
11
src/main.rs
11
src/main.rs
|
@ -1,11 +0,0 @@
|
||||||
use std::env;
|
|
||||||
use std::fs;
|
|
||||||
use std::path::PathBuf;
|
|
||||||
use sv_filelist_parser;
|
|
||||||
|
|
||||||
fn main() {
|
|
||||||
let args: Vec<String> = env::args().collect();
|
|
||||||
|
|
||||||
let filelist = sv_filelist_parser::parse_file(&args[1]).expect("Error parsing");
|
|
||||||
println!("{:#?}", filelist);
|
|
||||||
}
|
|
|
@ -1,6 +1,6 @@
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
use sv_filelist_parser;
|
use verilog_filelist_parser;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn simple_test() {
|
fn simple_test() {
|
||||||
|
@ -12,7 +12,7 @@ fn simple_test() {
|
||||||
defines.insert("ENV_VAR2".to_string(), Some("var2".to_string()));
|
defines.insert("ENV_VAR2".to_string(), Some("var2".to_string()));
|
||||||
defines.insert("RTL".to_string(), None);
|
defines.insert("RTL".to_string(), None);
|
||||||
|
|
||||||
let filelist_exp = sv_filelist_parser::Filelist {
|
let filelist_exp = verilog_filelist_parser::Filelist {
|
||||||
files: vec![
|
files: vec![
|
||||||
PathBuf::from("testcase/file1.sv"),
|
PathBuf::from("testcase/file1.sv"),
|
||||||
PathBuf::from("testcase/file2.sv"),
|
PathBuf::from("testcase/file2.sv"),
|
||||||
|
@ -29,6 +29,6 @@ fn simple_test() {
|
||||||
std::env::set_var("VAR1", "ENV_VAR1");
|
std::env::set_var("VAR1", "ENV_VAR1");
|
||||||
std::env::set_var("VAR2", "ENV_VAR2");
|
std::env::set_var("VAR2", "ENV_VAR2");
|
||||||
|
|
||||||
let filelist = sv_filelist_parser::parse_file("testcase/files.f").expect("Error parsing");
|
let filelist = verilog_filelist_parser::parse_file("testcase/files.f").expect("Error parsing");
|
||||||
assert_eq!(filelist_exp, filelist);
|
assert_eq!(filelist_exp, filelist);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue