diff options
| author | Cayetano Santos <csantosb@inventati.org> | 2025-10-03 16:04:28 +0200 |
|---|---|---|
| committer | Maxim Cournoyer <maxim@guixotic.coop> | 2025-10-08 15:40:46 +0900 |
| commit | ca36b0e0cc683ee13fc06aa6d404f56a3b019600 (patch) | |
| tree | 01dd041c46b6e7d058e59b82de5c684887b1165e | |
| parent | fdd621b9bbc6122eef07c2543e8173c3e770b635 (diff) | |
gnu: nextpnr: Implement built-in tests.
* gnu/packages/electronics.scm (nextpnr)[native-inputs]: Add iverilog
and gzip.
<#:phases>: Add run-tests.
Change-Id: I6e32015b7c0e1250931f3b844d1db705c298278f
Signed-off-by: Maxim Cournoyer <maxim@guixotic.coop>
| -rw-r--r-- | gnu/packages/electronics.scm | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/gnu/packages/electronics.scm b/gnu/packages/electronics.scm index 56ae42e74b7..a7d8af67dc3 100644 --- a/gnu/packages/electronics.scm +++ b/gnu/packages/electronics.scm @@ -937,10 +937,38 @@ which allows one to install the M8 firmware on any Teensy.") (("\\$\\{CMAKE_SOURCE_DIR}/3rdparty/sanitizers-cmake/cmake") (string-append #$(this-package-native-input "sanitizers-cmake") - "/share/sanitizers-cmake/cmake")))))))) + "/share/sanitizers-cmake/cmake"))))) + (add-after 'install 'run-tests + (lambda* (#:key tests? #:allow-other-keys) + (when tests? + (setenv "PATH" + (string-append #$output "/bin:" (getenv "PATH"))) + ;; ice40 + (invoke "./nextpnr-ice40-test") + (chdir "../source") + (setenv "NEXTPNR" "nextpnr-ice40") + (with-directory-excursion "ice40/smoketest/attosoc" + (invoke "./smoketest.sh")) + (with-directory-excursion "tests/ice40/regressions" + (invoke "make" (string-append + "NPNR=" #$output "/bin/nextpnr-ice40"))) + ;; generic + (setenv "NPNR" "nextpnr-generic") + (invoke "nextpnr-generic" "--uarch" "example" "--test") + (with-directory-excursion "tests/generic/flow/bel-pin" + (invoke "./run.sh")) + ;; ecp5 + (invoke "nextpnr-ecp5" + "--um5g-25k" "--package" "CABGA381" "--test") + (with-directory-excursion "tests/ecp5/regressions" + (invoke "make" + (string-append + "NPNR=" #$output "/bin/nextpnr-ecp5"))))))))) (native-inputs (list icestorm + iverilog googletest + gzip prjbeyond-db prjpeppercorn prjtrellis |
