From ad759b7c6dd6e25a58233857aa0c54682ad05c6d Mon Sep 17 00:00:00 2001 From: Daniel Barlow Date: Tue, 20 Sep 2022 16:09:44 +0100 Subject: [PATCH] allow changing hardware device in tests --- devices/qemu.nix | 11 +++++++++++ run-tests.sh | 1 + tests/smoke/run.sh | 2 +- 3 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 devices/qemu.nix diff --git a/devices/qemu.nix b/devices/qemu.nix new file mode 100644 index 0000000..51e27d8 --- /dev/null +++ b/devices/qemu.nix @@ -0,0 +1,11 @@ +{ + system = { + crossSystem = { + config = "mips-unknown-linux-musl"; + gcc = { + abi = "32"; + arch = "mips32"; # maybe mips_24kc- + }; + }; + }; +} diff --git a/run-tests.sh b/run-tests.sh index 3568b14..48c8395 100755 --- a/run-tests.sh +++ b/run-tests.sh @@ -1,5 +1,6 @@ #!/usr/bin/env bash +export DEVICE=${DEVICE-qemu} export TMPDIR=${TMPDIR-/tmp} for i in tests/*/run.sh; do diff --git a/tests/smoke/run.sh b/tests/smoke/run.sh index 0316302..42fa2bb 100755 --- a/tests/smoke/run.sh +++ b/tests/smoke/run.sh @@ -1,5 +1,5 @@ set -e -NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM=1 nix-build -I liminix-config=./tests/smoke/configuration.nix -o smoke.img +NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM=1 nix-build -I liminix-config=./tests/smoke/configuration.nix --arg device "import ./devices/$DEVICE.nix" -o smoke.img TESTS=$(cat <<"EOF"