Skip to content

Commit

Permalink
Update tests to use config.toml instead
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Feb 9, 2024
1 parent 5fe3c69 commit 1b21b82
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
7 changes: 7 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ tempfile = "3.7.1"
[dev-dependencies]
lang_tester = "0.3.9"
tempfile = "3.1.0"
boml = "0.3.1"

[profile.dev]
# By compiling dependencies with optimizations, performing tests gets much faster.
Expand Down
8 changes: 6 additions & 2 deletions tests/lang_tests_common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use std::{

use lang_tester::LangTester;
use tempfile::TempDir;
use boml::Toml;

/// Controls the compile options (e.g., optimization level) used to compile
/// test code.
Expand All @@ -20,8 +21,11 @@ pub fn main_inner(profile: Profile) {
let tempdir = TempDir::new().expect("temp dir");
let current_dir = current_dir().expect("current dir");
let current_dir = current_dir.to_str().expect("current dir").to_string();
let gcc_path = include_str!("../gcc_path");
let gcc_path = gcc_path.trim();
let gcc_path = Toml::parse(include_str!("../config.toml"))
.expect("Failed to parse `config.toml`")
.get_string("gcc-path")
.expect("Missing `gcc-path` key in `config.toml`")
.to_string();
env::set_var("LD_LIBRARY_PATH", gcc_path);

fn rust_filter(filename: &Path) -> bool {
Expand Down

0 comments on commit 1b21b82

Please sign in to comment.