Skip to content

Commit

Permalink
Merge branch 'main' into first_additions
Browse files Browse the repository at this point in the history
  • Loading branch information
ozgurakgun authored Oct 14, 2024
2 parents 2fdc25e + e2f13bd commit adc03a5
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 34 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,5 +83,8 @@ jobs:
- nightly
steps:
- uses: actions/checkout@v3
- name: Run sccache-cache
uses: mozilla-actions/[email protected]
- run: rustup update ${{ matrix.rust_release }} && rustup default ${{ matrix.rust_release }}
- run: cargo install cargo-audit
- run: cargo audit
106 changes: 72 additions & 34 deletions conjure_oxide/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,43 +18,81 @@ fn main() -> io::Result<()> {
for subdir in WalkDir::new(test_dir) {
let subdir = subdir?;
if subdir.file_type().is_dir() {
let stems: Vec<String> = read_dir(subdir.path())?
.filter_map(Result::ok)
.filter(|entry| {
entry
.path()
.extension()
.map_or(false, |ext| ext == "essence" || ext == "eprime")
})
.filter_map(|entry| {
entry
.path()
.file_stem()
.and_then(|stem| stem.to_str())
.map(|s| s.to_owned())
})
.collect();
if std::env::var("ALLTEST").is_ok() {
let stems: Vec<String> = read_dir(subdir.path())?
.filter_map(Result::ok)
.filter(|entry| {
entry.path().extension().map_or(false, |ext| {
ext == "essence" || ext == "eprime" || ext == "disabled"
})
})
.filter_map(|entry| {
entry
.path()
.file_stem()
.and_then(|stem| stem.to_str())
.map(|s| s.to_owned())
})
.collect();

let exts: Vec<String> = read_dir(subdir.path())?
.filter_map(Result::ok)
.filter(|entry| {
entry
.path()
.extension()
.map_or(false, |ext| ext == "essence" || ext == "eprime")
})
.filter_map(|entry| {
entry
.path()
.extension()
.and_then(|ext| ext.to_str())
.map(|s| s.to_owned())
})
.collect();
let exts: Vec<String> = read_dir(subdir.path())?
.filter_map(Result::ok)
.filter(|entry| {
entry.path().extension().map_or(false, |ext| {
ext == "essence" || ext == "eprime" || ext == "disabled"
})
})
.filter_map(|entry| {
entry
.path()
.extension()
.and_then(|ext| ext.to_str())
.map(|s| s.to_owned())
})
.collect();

let essence_files = std::iter::zip(stems, exts).collect();
let essence_files = std::iter::zip(stems, exts).collect();

write_test(&mut f, subdir.path().display().to_string(), essence_files)?;
write_test(&mut f, subdir.path().display().to_string(), essence_files)?;
} else {
let stems: Vec<String> = read_dir(subdir.path())?
.filter_map(Result::ok)
.filter(|entry| {
entry
.path()
.extension()
.map_or(false, |ext| ext == "essence" || ext == "eprime")
})
.filter_map(|entry| {
entry
.path()
.file_stem()
.and_then(|stem| stem.to_str())
.map(|s| s.to_owned())
})
.collect();

let exts: Vec<String> = read_dir(subdir.path())?
.filter_map(Result::ok)
.filter(|entry| {
entry
.path()
.extension()
.map_or(false, |ext| ext == "essence" || ext == "eprime")
})
.filter_map(|entry| {
entry
.path()
.extension()
.and_then(|ext| ext.to_str())
.map(|s| s.to_owned())
})
.collect();

let essence_files = std::iter::zip(stems, exts).collect();

write_test(&mut f, subdir.path().display().to_string(), essence_files)?;
}
}
}

Expand Down

0 comments on commit adc03a5

Please sign in to comment.