|
129 | 129 | meta.mainProgram = pname; |
130 | 130 | }; |
131 | 131 |
|
132 | | - sonata-sim-boot-stub = pkgs.stdenv.mkDerivation rec { |
| 132 | + sonata-sim-boot-stub = pkgs.stdenv.mkDerivation { |
133 | 133 | inherit version; |
134 | 134 | pname = "sonata-sim-boot-stub"; |
135 | 135 | src = sw/cheri/sim_boot_stub/.; |
|
190 | 190 | }; |
191 | 191 | }; |
192 | 192 |
|
193 | | - tests-runner = pkgs.writeShellApplication { |
194 | | - name = "tests-runner"; |
195 | | - runtimeInputs = with pkgs; [ |
196 | | - openocd |
197 | | - (python3.withPackages (pyPkg: with pyPkg; [pyserial])) |
198 | | - ]; |
199 | | - checkPhase = ""; |
| 193 | + tests-fpga = pkgs.writeShellApplication { |
| 194 | + name = "tests-fpga"; |
| 195 | + runtimeInputs = [pythonEnv]; |
200 | 196 | text = '' |
201 | | - python ./util/test_runner.py $@ |
| 197 | + set +u |
| 198 | + if [ -z "$1" ]; then |
| 199 | + echo "Please provide the tty device location (e.g. /dev/ttyUSB2)" \ |
| 200 | + "as the first argument." |
| 201 | + exit 2 |
| 202 | + fi |
| 203 | + ${./util/test_runner.py} -t 30 fpga "$1" \ |
| 204 | + --elf-file ${sonata-system-software}/bin/test_runner \ |
| 205 | + --tcl-file ${./util/sonata-openocd-cfg.tcl} |
202 | 206 | ''; |
203 | 207 | }; |
204 | 208 |
|
205 | | - tests-fpga-runner = pkgs.writers.writeBashBin "tests-fpga-runner" '' |
206 | | - set -e |
207 | | - if [ -z "$1" ]; then |
208 | | - echo "Please provide the tty device location (e.g. /dev/ttyUSB2)" \ |
209 | | - "as the first argument." |
210 | | - exit 2 |
211 | | - fi |
212 | | - ${getExe tests-runner} -t 30 fpga $1 \ |
213 | | - --elf-file ${sonata-system-software}/bin/test_runner \ |
214 | | - --tcl-file ${./util/sonata-openocd-cfg.tcl} |
215 | | - #$\{getExe tests-runner} -t 30 fpga $1 --uf2-file $\{cheriot-rtos-test-suite}/share/test-suite.uf2 |
216 | | - ''; |
217 | | - |
218 | 209 | tests-simulator = pkgs.stdenvNoCC.mkDerivation { |
219 | 210 | name = "tests-simulator"; |
220 | 211 | src = ./.; |
221 | 212 | dontBuild = true; |
222 | 213 | doCheck = true; |
223 | | - buildInputs = [sonata-simulator]; |
| 214 | + buildInputs = [sonata-simulator pythonEnv]; |
224 | 215 | checkPhase = '' |
225 | | - ${getExe tests-runner} -t 30 sim \ |
| 216 | + python ${./util/test_runner.py} -t 30 sim \ |
226 | 217 | --elf-file ${sonata-system-software}/bin/test_runner |
227 | | - #$\{getExe tests-runner} -t 600 sim \ |
228 | | - # --sim-boot-stub $\{sonata-sim-boot-stub.out}/share/sim_boot_stub \ |
229 | | - # --elf-file $\{cheriot-rtos-test-suite}/share/test-suite |
230 | 218 | ''; |
231 | 219 | installPhase = "mkdir $out"; |
232 | 220 | }; |
|
251 | 239 | ]) |
252 | 240 | ++ (with sonata-simulator; buildInputs ++ nativeBuildInputs); |
253 | 241 | }; |
254 | | - packages = {inherit sonata-simulator sonata-sim-boot-stub sonata-documentation sonata-system-software cheriot-rtos-test-suite;}; |
255 | | - checks = {inherit sonata-simulator-lint tests-simulator;}; |
| 242 | + packages = { |
| 243 | + inherit |
| 244 | + sonata-simulator |
| 245 | + sonata-simulator-lint |
| 246 | + sonata-sim-boot-stub |
| 247 | + sonata-documentation |
| 248 | + sonata-system-software |
| 249 | + cheriot-rtos-test-suite |
| 250 | + ; |
| 251 | + }; |
| 252 | + checks = {inherit tests-simulator;}; |
256 | 253 | apps = builtins.listToAttrs (map (program: { |
257 | 254 | inherit (program) name; |
258 | 255 | value = { |
259 | 256 | type = "app"; |
260 | 257 | program = getExe program; |
261 | 258 | }; |
262 | | - }) [lint-all lint-markdown lint-python tests-runner tests-fpga-runner]); |
| 259 | + }) [lint-all lint-markdown lint-python tests-fpga]); |
263 | 260 | }; |
264 | 261 | in |
265 | 262 | flake-utils.lib.eachDefaultSystem system_outputs; |
|
0 commit comments