remove leading comma from macro expansion

This commit is contained in:
DebugSteven 2022-11-28 16:08:00 -07:00
parent c49555821f
commit b2cd3374e9
4 changed files with 7 additions and 25 deletions

View File

@ -934,8 +934,8 @@ def main():
if len(sys.argv) > 1 and sys.argv[1] == 'help': if len(sys.argv) > 1 and sys.argv[1] == 'help':
sys.argv = [sys.argv[0], '-h'] + sys.argv[2:] sys.argv = [sys.argv[0], '-h'] + sys.argv[2:]
help_triggered = ( # help_triggered = ('-h' in sys.argv) or ('--help' in sys.argv) or (len(sys.argv) == 1)
'-h' in sys.argv) or ('--help' in sys.argv) or (len(sys.argv) == 1) help_triggered = len(sys.argv) == 1 or any(x in ["-h", "--help", "--version"] for x in sys.argv)
try: try:
bootstrap(help_triggered) bootstrap(help_triggered)
if not help_triggered: if not help_triggered:

View File

@ -69,4 +69,4 @@ pub mod ui_tests;
pub mod unit_tests; pub mod unit_tests;
pub mod unstable_book; pub mod unstable_book;
pub mod walk; pub mod walk;
pub mod x; pub mod x_version;

View File

@ -53,34 +53,18 @@ fn main() {
VecDeque::with_capacity(concurrency.get()); VecDeque::with_capacity(concurrency.get());
macro_rules! check { macro_rules! check {
($p:ident) => {
while handles.len() >= concurrency.get() {
handles.pop_front().unwrap().join().unwrap();
}
let handle = s.spawn(|| {
let mut flag = false;
$p::check(&mut flag);
if (flag) {
bad.store(true, Ordering::Relaxed);
}
});
handles.push_back(handle);
};
($p:ident $(, $args:expr)* ) => { ($p:ident $(, $args:expr)* ) => {
drain_handles(&mut handles); drain_handles(&mut handles);
let handle = s.spawn(|| { let handle = s.spawn(|| {
let mut flag = false; let mut flag = false;
$p::check($($args),* , &mut flag); $p::check($($args, )* &mut flag);
if (flag) { if (flag) {
bad.store(true, Ordering::Relaxed); bad.store(true, Ordering::Relaxed);
} }
}); });
handles.push_back(handle); handles.push_back(handle);
}; }
} }
check!(target_specific_tests, &src_path); check!(target_specific_tests, &src_path);
@ -123,7 +107,7 @@ fn main() {
check!(alphabetical, &compiler_path); check!(alphabetical, &compiler_path);
check!(alphabetical, &library_path); check!(alphabetical, &library_path);
check!(x); check!(x_version);
let collected = { let collected = {
drain_handles(&mut handles); drain_handles(&mut handles);

View File

@ -1,9 +1,7 @@
use std::process::Command; use std::process::Command;
pub fn check(_bad: &mut bool) { pub fn check(_bad: &mut bool) {
let result = Command::new("x") let result = Command::new("x").arg("--version").output();
.arg("--version")
.output();
let output = match result { let output = match result {
Ok(output) => output, Ok(output) => output,
Err(_e) => todo!(), Err(_e) => todo!(),