mirror of
https://github.com/rust-embedded/rust-raspberrypi-OS-tutorials.git
synced 2024-11-11 07:10:59 +00:00
Fix script generation in Makefile
This would fail if the target folder didnt exist already.
This commit is contained in:
parent
1b164e50a1
commit
447b0aaa4e
@ -1,6 +1,6 @@
|
||||
## SPDX-License-Identifier: MIT OR Apache-2.0
|
||||
##
|
||||
## Copyright (c) 2018-2019 Andre Richter <andre.o.richter@gmail.com>
|
||||
## Copyright (c) 2018-2020 Andre Richter <andre.o.richter@gmail.com>
|
||||
|
||||
# Default to the RPi3
|
||||
ifndef BSP
|
||||
@ -98,7 +98,7 @@ qemu: all
|
||||
$(DOCKER_EXEC_QEMU) $(QEMU_RELEASE_ARGS) \
|
||||
-kernel $(OUTPUT)
|
||||
|
||||
define kernel_test_runner
|
||||
define KERNEL_TEST_RUNNER
|
||||
#!/usr/bin/env bash
|
||||
|
||||
$(OBJCOPY_CMD) $$1 $$1.img
|
||||
@ -107,9 +107,10 @@ define kernel_test_runner
|
||||
ruby tests/runner.rb $(DOCKER_EXEC_QEMU) $(QEMU_TEST_ARGS) -kernel $$TEST_BINARY
|
||||
endef
|
||||
|
||||
export KERNEL_TEST_RUNNER
|
||||
test: $(SOURCES)
|
||||
@mkdir -p target
|
||||
$(file > target/kernel_test_runner.sh,$(kernel_test_runner))
|
||||
@echo "$$KERNEL_TEST_RUNNER" > target/kernel_test_runner.sh
|
||||
@chmod +x target/kernel_test_runner.sh
|
||||
RUSTFLAGS="$(RUSTFLAGS_PEDANTIC)" $(XTEST_CMD) $(TEST_ARG)
|
||||
endif
|
||||
|
@ -341,7 +341,7 @@ The file `kernel_test_runner.sh` does not exist by default. We generate it on de
|
||||
`make test` target:
|
||||
|
||||
```Makefile
|
||||
define kernel_test_runner
|
||||
define KERNEL_TEST_RUNNER
|
||||
#!/usr/bin/env bash
|
||||
|
||||
$(OBJCOPY_CMD) $$1 $$1.img
|
||||
@ -350,9 +350,10 @@ define kernel_test_runner
|
||||
ruby tests/runner.rb $(DOCKER_EXEC_QEMU) $(QEMU_TEST_ARGS) -kernel $$TEST_BINARY
|
||||
endef
|
||||
|
||||
export KERNEL_TEST_RUNNER
|
||||
test: $(SOURCES)
|
||||
@mkdir -p target
|
||||
$(file > target/kernel_test_runner.sh,$(kernel_test_runner))
|
||||
@echo "$$KERNEL_TEST_RUNNER" > target/kernel_test_runner.sh
|
||||
@chmod +x target/kernel_test_runner.sh
|
||||
RUSTFLAGS="$(RUSTFLAGS_PEDANTIC)" $(XTEST_CMD) $(TEST_ARG)
|
||||
endif
|
||||
|
Loading…
Reference in New Issue
Block a user