Add more support test files

This commit is contained in:
Wildan M
2026-03-25 04:16:16 +07:00
parent d7c14e94af
commit 000cd996f3
3 changed files with 39 additions and 8 deletions
+1 -1
View File
@@ -103,7 +103,7 @@ run_redoxer() {
if [ "$IS_HOST" -eq 0 ]; then
redoxer toolchain || { echo -e "${RED}Fail: redoxer toolchain for: $target.${NC}" && exit 1; }
export CARGO_TEST="redoxer"
export TEST_RUNNER="redoxer exec --folder ../sysroot/$TARGET/:/usr --folder . --"
export TEST_RUNNER="redoxer exec --folder ../../sysroot/$TARGET/:/usr --folder . --"
# TODO: Identify hang issue with pthread/barrier and pthread/once tests in multi core to get rid of this limit
export REDOXER_QEMU_ARGS="-smp 1"
+26 -4
View File
@@ -16,12 +16,26 @@ all: $(BINS)
clean:
rm -rf $(BUILD)/bins_* $(BUILD)/gen $(BUILD)/target
build: $(BUILD)/bins_verify/relibc-tests $(BINS) $(EXPECT_BINS) $(EXPECT_INPUT_BINS) support_build $(BUILD)/expected
build: $(BUILD)/bins_verify/relibc-tests $(BINS) $(EXPECT_BINS) $(EXPECT_INPUT_BINS) support_build
# "run" and "run-once" does not copy "expected" so the test runner will not pick outdated "expected" file
support_build: $(BUILD)/Makefile $(BUILD)/Makefile.tests.mk $(BUILD)/example_dir
support_build: $(BUILD)/expected \
$(BUILD)/Makefile \
$(BUILD)/Makefile.tests.mk \
$(BUILD)/example_dir \
$(BUILD)/select.c \
$(BUILD)/stdlib/realpath.c \
$(BUILD)/stdio/fread.in \
$(BUILD)/stdio/fscanf_offby1.c \
$(BUILD)/stdio/fscanf.c \
$(BUILD)/stdio/stdio.in \
$(BUILD)/stdio/getline.in \
$(BUILD)/stdio/ungetc_ftell.c \
$(BUILD)/sys_stat/stat.c \
$(BUILD)/unistd/link.c \
$(BUILD)/wchar/fgetwc.in \
$(BUILD)/wchar/ungetwc.in
run: $(BUILD)/bins_verify/relibc-tests $(BINS) $(EXPECT_BINS) $(EXPECT_INPUT_BINS) support_build
run: build
$(MAKE) run -C $(BUILD)
run-once: $(BUILD)/bins_verify/relibc-tests $(BUILD)/$(TESTBIN) support_build
@@ -46,6 +60,14 @@ $(BUILD)/example_dir: example_dir
rm -rf "$@"
cp -a "$<" $(BUILD)/
$(BUILD)/%.in: %.in
@mkdir -p "$$(dirname "$@")"
cp "$*.in" "$@"
$(BUILD)/%.c: %.c
@mkdir -p "$$(dirname "$@")"
cp "$*.c" "$@"
FLAGS=\
-std=c11 \
-fno-builtin \
+12 -3
View File
@@ -10,7 +10,7 @@ use std::{
time::{Duration, Instant},
};
fn find_expected_dir() -> Result<PathBuf, String> {
fn find_expected_dir() -> Option<PathBuf> {
let mut current_dir = env::current_exe()
.ok()
.and_then(|p| p.parent().map(|parent| parent.to_path_buf()))
@@ -26,7 +26,16 @@ fn find_expected_dir() -> Result<PathBuf, String> {
}
}
found_expected_dir.ok_or_else(|| "Could not find 'expected' directory".to_string())
if found_expected_dir.is_none() {
if let Ok(cwd) = env::current_dir() {
let check = cwd.join("expected");
if check.is_dir() {
found_expected_dir = Some(check);
}
}
}
found_expected_dir
}
fn expected(
@@ -233,7 +242,7 @@ fn main() {
};
if !status_only {
let Ok(expected_dir) = &expected_dir else {
let Some(expected_dir) = &expected_dir else {
eprintln!("Expected directory not found");
process::exit(1);
};