Skip to content

Commit 75a89eb

Browse files
committed
add precision in selecting correct testing binaries, reintroduce testing to pipeline
1 parent bd71c44 commit 75a89eb

File tree

3 files changed

+16
-11
lines changed

3 files changed

+16
-11
lines changed

.github/workflows/makefile.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,5 @@ jobs:
3131
- name: Install qemu
3232
run: sudo apt-get install qemu-system
3333

34-
- name: Run build
35-
run: make
34+
- name: Run build & test
35+
run: make test

kernel/.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
/kernel
22
/target
3-
/kernel-test
3+
/kernel-test
4+
.test-log.txt

kernel/GNUmakefile

+12-8
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,19 @@ all:
2929
cp target/$(RUST_TARGET)/$(RUST_PROFILE_SUBDIR)/hexium_os kernel
3030

3131
test:
32-
RUSTFLAGS="-C relocation-model=static" cargo build --tests --target $(RUST_TARGET) --profile $(RUST_PROFILE)
33-
3432
mkdir -p kernel-test
35-
36-
# Copy first two hexium_os-* test binaries - the third appears to be a normal build exec.
37-
find target/$(RUST_TARGET)/$(RUST_PROFILE_SUBDIR)/deps -maxdepth 1 -type f -executable -name 'hexium_os-*' | head -n 2 | xargs -I{} cp {} kernel-test/
38-
39-
# Copy all remain integration test binaries except hexium_os-*
40-
find target/$(RUST_TARGET)/$(RUST_PROFILE_SUBDIR)/deps -maxdepth 1 -type f -executable ! -name 'hexium_os-*' -exec cp {} kernel-test/ \;
33+
RUSTFLAGS="-C relocation-model=static" cargo test --no-run --target $(RUST_TARGET) --profile $(RUST_PROFILE) --color always \
34+
2>&1 | tee .test-log.txt
35+
@grep -o 'target/[^ )]*' .test-log.txt | while read -r path; do \
36+
if [ -x "$$path" ]; then \
37+
echo "Copying $$path to kernel-test/"; \
38+
cp "$$path" kernel-test/; \
39+
else \
40+
echo "Skipping non-executable: $$path"; \
41+
fi \
42+
done
43+
44+
@rm .test-log.txt
4145

4246
.PHONY: clean
4347
clean:

0 commit comments

Comments
 (0)