abou
aboutsummaryrefslogtreecommitdiff
path: root/nix/libstore/builtins.hh
blob: 396ea14ebc08146fe62a13a293338b8e73767628 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/* GNU Guix --- Functional package management for GNU
   Copyright (C) 2016, 2017 Ludovic Courtès <ludo@gnu.org>

   This file is part of GNU Guix.

   GNU Guix is free software; you can redistribute it and/or modify it
   under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 3 of the License, or (at
   your option) any later version.

   GNU Guix is distributed in the hope that it will be useful, but
   WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.  */

/* Interface to built-in derivation builders.  */

#pragma once

#include <derivations.hh>
#include <map>
#include <string>

namespace nix {

    inline bool isBuiltin(const Derivation & drv)
    {
	return string(drv.builder, 0, 8) == "builtin:";
    }

    /* Build DRV, which lives at DRVPATH.  */
    typedef void (*derivationBuilder) (const Derivation &drv,
				       const std::string &drvPath,
				       const std::string &output);

    /* Return the built-in builder called BUILDER, or NULL if none was
       found.  */
    derivationBuilder lookupBuiltinBuilder(const std::string &builder);

    /* Return the list of supported built-in builder names.  */
    std::list<std::string> builtinBuilderNames();
}

index 3e26f5f374..12a7a24c21 100644
--- a/gnu/packages/golang-check.scm
+++ b/gnu/packages/golang-check.scm
@@ -1003,6 +1003,34 @@ custom assertions to be used alongside native Go testing.")
(arguments
(list #:import-path "github.com/go-playground/assert/v2"))))
+(define-public go-github-com-warpfork-go-wish
+ (package
+ (name "go-github-com-warpfork-go-wish")
+ (version "0.0.0-20220906213052-39a1cc7a02d0")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/warpfork/go-wish")
+ (commit (go-version->git-ref version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "0rqbxmqwzy1q2zwy3mszp0li0pg8zzh3j9l8wlzr6p1pq2idallq"))
+ (patches (search-patches
+ "go-github-com-warpfork-go-wish-fix-tests.patch"))))
+ (build-system go-build-system)
+ (arguments
+ (list
+ #:go go-1.21
+ #:import-path "github.com/warpfork/go-wish"))
+ (home-page "https://github.com/warpfork/go-wish")
+ (synopsis "Test assertions for Golang")
+ (description
+ "@code{wish} is a test assertion library for Golang, designed to
+gracefully enhance standard library testing package and behaviors of the
+@command{go test} command.")
+ (license license:expat)))
+
(define-public go-go-uber-org-goleak
(package
(name "go-go-uber-org-goleak")
diff --git a/gnu/packages/patches/go-github-com-warpfork-go-wish-fix-tests.patch b/gnu/packages/patches/go-github-com-warpfork-go-wish-fix-tests.patch
new file mode 100644
index 0000000000..27738ac59b
--- /dev/null
+++ b/gnu/packages/patches/go-github-com-warpfork-go-wish-fix-tests.patch
@@ -0,0 +1,85 @@
+From d53c651a8fd65656e486eb5c7e20ab889f64639b Mon Sep 17 00:00:00 2001
+From: "Artyom V. Poptsov" <poptsov.artyom@gmail.com>
+Date: Sun, 28 Apr 2024 13:24:34 +0300
+Subject: [PATCH] output_test.go: Fix tests
+
+* output_test.go (TestGoTestOutputTree, TestGoTestOutputFun): Fix
+ tests.
+---
+ output_test.go | 40 ++++++++++++++++++++--------------------
+ 1 file changed, 20 insertions(+), 20 deletions(-)
+
+diff --git a/output_test.go b/output_test.go
+index eb3e0e9..58948c2 100644
+--- a/output_test.go
++++ b/output_test.go
+@@ -75,15 +75,15 @@ func TestGoTestOutputTree(t *testing.T) {
+ diff := strdiff(nom, Dedent(`
+ === RUN TestGoTestOutputTree_helper
+ === RUN TestGoTestOutputTree_helper/subtest
++ output_test.go:NN: wtf
+ === RUN TestGoTestOutputTree_helper/subtest/subsubtest
++ output_test.go:NN: sadz
+ === RUN TestGoTestOutputTree_helper/subtest/happy_subsubtest
++ output_test.go:NN: ooh!
+ --- FAIL: TestGoTestOutputTree_helper (N.NNs)
+ --- FAIL: TestGoTestOutputTree_helper/subtest (N.NNs)
+- output_test.go:NN: wtf
+ --- FAIL: TestGoTestOutputTree_helper/subtest/subsubtest (N.NNs)
+- output_test.go:NN: sadz
+ --- PASS: TestGoTestOutputTree_helper/subtest/happy_subsubtest (N.NNs)
+- output_test.go:NN: ooh!
+ FAIL
+ exit status N
+ FAIL github.com/warpfork/go-wish N.NNNs
+@@ -149,28 +149,28 @@ func TestGoTestOutputFun(t *testing.T) {
+ diff := strdiff(nom, Dedent(`
+ === RUN TestGoTestOutputFun_helper
+ === RUN TestGoTestOutputFun_helper/subtest
++ output_test.go:NNN: hello!
+ === RUN TestGoTestOutputFun_helper/subtest/subsubtest
++ output_test.go:NNN: ShouldEqual check rejected:
++ @@ -N +N @@
++ - snafoo
++ + zounds
++
++ output_test.go:NNN: ShouldEqual check rejected:
++ @@ -N +N @@
++ - zebras
++ + cats
++
++ output_test.go:NNN: ShouldEqual check rejected:
++ interface{}(
++ - struct{ Foo string }{},
++ + struct{ Bar string }{},
++ )
++
+ === RUN TestGoTestOutputFun_helper/subtest/happy_subsubtest
+ --- FAIL: TestGoTestOutputFun_helper (N.NNs)
+ --- FAIL: TestGoTestOutputFun_helper/subtest (N.NNs)
+- output_test.go:NNN: hello!
+ --- FAIL: TestGoTestOutputFun_helper/subtest/subsubtest (N.NNs)
+- output_test.go:NNN: ShouldEqual check rejected:
+- @@ -N +N @@
+- - snafoo
+- + zounds
+-
+- output_test.go:NNN: ShouldEqual check rejected:
+- @@ -N +N @@
+- - zebras
+- + cats
+-
+- output_test.go:NNN: ShouldEqual check rejected:
+- interface{}(
+- - struct{ Foo string }{},
+- + struct{ Bar string }{},
+- )
+-
+ --- PASS: TestGoTestOutputFun_helper/subtest/happy_subsubtest (N.NNs)
+ FAIL
+ exit status N
+
+base-commit: 39a1cc7a02d01d037bc6bc075e6550279026e645
+--
+2.41.0
+