use alloc::string::String;
use alloc::vec;
use alloc::vec::Vec;
use linux_syscall_api::read_file;
pub fn get_envs() -> Vec<String> {
let mut envs:Vec<String> = vec![
"SHLVL=1".into(),
"PWD=/".into(),
"GCC_EXEC_PREFIX=/riscv64-linux-musl-native/bin/../lib/gcc/".into(),
"COLLECT_GCC=./riscv64-linux-musl-native/bin/riscv64-linux-musl-gcc".into(),
"COLLECT_LTO_WRAPPER=/riscv64-linux-musl-native/bin/../libexec/gcc/riscv64-linux-musl/11.2.1/lto-wrapper".into(),
"COLLECT_GCC_OPTIONS='-march=rv64gc' '-mabi=lp64d' '-march=rv64imafdc' '-dumpdir' 'a.'".into(),
"LIBRARY_PATH=/lib/".into(),
"LD_LIBRARY_PATH=/lib/".into(),
"LD_DEBUG=files".into(),
];
if let Some(environment_vars) = read_file("/etc/environment") {
envs.push(environment_vars);
} else {
envs.push("PATH=/usr/sbin:/usr/bin:/sbin:/bin".into());
}
envs
}
pub fn run_testcase(testcase: &str) {
linux_syscall_api::run_testcase(testcase, get_envs());
}
pub fn println(s: &str) {
axlog::ax_println!("{}", s);
}