mirror of
https://codeberg.org/demostf/api-client.git
synced 2026-06-03 16:44:09 +02:00
flake reorg, nix integration testing
This commit is contained in:
parent
06b003ec6e
commit
5cfd70d583
14 changed files with 3221 additions and 145 deletions
42
nix/test-runner.nix
Normal file
42
nix/test-runner.nix
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
{
|
||||
rustPlatform,
|
||||
openssl,
|
||||
pkg-config,
|
||||
lib,
|
||||
}: let
|
||||
inherit (lib.sources) sourceByRegex;
|
||||
inherit (builtins) fromTOML readFile;
|
||||
src = sourceByRegex ../. ["Cargo.*" "(src|tests)(/.*)?"];
|
||||
cargoPackage = (fromTOML (readFile ../Cargo.toml)).package;
|
||||
in
|
||||
rustPlatform.buildRustPackage {
|
||||
pname = cargoPackage.name;
|
||||
inherit (cargoPackage) version;
|
||||
|
||||
inherit src;
|
||||
|
||||
buildInputs = [
|
||||
openssl
|
||||
];
|
||||
|
||||
nativeBuildInputs = [
|
||||
pkg-config
|
||||
];
|
||||
|
||||
doCheck = false;
|
||||
|
||||
buildPhase = ''
|
||||
cargo build --tests
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/bin
|
||||
cp target/debug/deps/tests-???????????????? $out/bin/api-test
|
||||
'';
|
||||
|
||||
cargoLock = {
|
||||
lockFile = ../Cargo.lock;
|
||||
};
|
||||
|
||||
meta.mainProgram = "api-test";
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue