From 7af143e73bb18992f9d65d0302da42c1fae87b1d Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Sun, 31 Mar 2019 22:33:19 +0800 Subject: [PATCH] run ARTIQ lit tests. Closes #3 --- artiq/default.nix | 2 +- artiq/pkgs/artiq.nix | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/artiq/default.nix b/artiq/default.nix index 54734bf..235ef74 100644 --- a/artiq/default.nix +++ b/artiq/default.nix @@ -42,7 +42,7 @@ in llvm-or1k = callPackage ./pkgs/llvm-or1k.nix { inherit llvm-src; }; llvmlite-artiq = callPackage ./pkgs/llvmlite-artiq.nix { inherit llvm-or1k; }; libartiq-support = callPackage ./pkgs/libartiq-support.nix { inherit rustc; }; - artiq = callPackage ./pkgs/artiq.nix { inherit binutils-or1k; inherit llvm-or1k; inherit llvmlite-artiq; }; + artiq = callPackage ./pkgs/artiq.nix { inherit binutils-or1k llvm-or1k llvmlite-artiq libartiq-support lit outputcheck; }; artiq-env = (pkgs.python3.withPackages(ps: [ artiq ])).overrideAttrs (oldAttrs: { name = "${pkgs.python3.name}-artiq-env-${artiq.version}"; }); openocd = callPackage ./pkgs/openocd.nix {}; conda-artiq = import ./conda-artiq.nix { inherit pkgs; }; diff --git a/artiq/pkgs/artiq.nix b/artiq/pkgs/artiq.nix index 80cfc42..802f9be 100644 --- a/artiq/pkgs/artiq.nix +++ b/artiq/pkgs/artiq.nix @@ -1,4 +1,4 @@ -{ stdenv, callPackage, fetchgit, python3Packages, qt5Full, binutils-or1k, llvm-or1k, llvmlite-artiq }: +{ stdenv, callPackage, fetchgit, python3Packages, qt5Full, binutils-or1k, llvm-or1k, llvmlite-artiq, libartiq-support, lit, outputcheck }: let pythonDeps = callPackage ./python-deps.nix {}; @@ -11,7 +11,15 @@ in propagatedBuildInputs = [ binutils-or1k llvm-or1k llvmlite-artiq qt5Full ] ++ (with pythonDeps; [ levenshtein pyqtgraph-qt5 quamash pythonparser asyncserial ]) ++ (with python3Packages; [ aiohttp pygit2 numpy dateutil scipy prettytable pyserial h5py pyqt5 ]); - checkPhase = "python -m unittest discover -v artiq.test"; + buildInputs = [ outputcheck ]; + checkPhase = + '' + python -m unittest discover -v artiq.test + + testdir=`mktemp -d` + cp --no-preserve=mode,ownership -R ${src}/artiq/test/lit $testdir + LIBARTIQ_SUPPORT=${libartiq-support}/libartiq_support.so ${lit}/bin/lit -v $testdir/lit + ''; meta = with stdenv.lib; { description = "A leading-edge control system for quantum information experiments"; homepage = https://m-labs/artiq;