about summary refs log tree commit diff
path: root/pkgs/test
diff options
context:
space:
mode:
authorMartin Messer <martin.messer@cyberus-technology.de>2022-06-20 11:17:09 +0200
committerMartin Messer <martin.messer@cyberus-technology.de>2023-12-07 16:38:48 +0100
commitc8afee88bf346c80f79d036e34ca2d232b037792 (patch)
treea1cd53ec96996f841dbf9e7a87b8c3fab386f517 /pkgs/test
parentcd6c65fe2d96e8342f85f8467dee9b76618a144d (diff)
checkpointedBuild: fix tests for checkpointedBuild functions
Diffstat (limited to 'pkgs/test')
-rw-r--r--pkgs/test/incrementalBuild/default.nix10
-rw-r--r--pkgs/test/incrementalBuild/hello-additionalFile.patch45
-rw-r--r--pkgs/test/incrementalBuild/hello-removeFile.patch43
3 files changed, 54 insertions, 44 deletions
diff --git a/pkgs/test/incrementalBuild/default.nix b/pkgs/test/incrementalBuild/default.nix
index cff1efee9a126..c11c9835ccbf9 100644
--- a/pkgs/test/incrementalBuild/default.nix
+++ b/pkgs/test/incrementalBuild/default.nix
@@ -1,6 +1,6 @@
 { hello, buildIncremental, runCommandNoCC, texinfo, stdenv, rsync }:
 let
-  baseHello = buildIncremental.prepareIncrementalBuild hello;
+  baseHelloArtifacts = buildIncremental.prepareIncrementalBuild hello;
   patchedHello = hello.overrideAttrs (old: {
     buildInputs = [ texinfo ];
     src = runCommandNoCC "patch-hello-src" { } ''
@@ -10,17 +10,17 @@ let
       patch -p1 < ${./hello.patch}
     '';
   });
-  incrementalBuiltHello = buildIncremental.mkIncrementalBuild patchedHello baseHello.incrementalBuildArtifacts;
+  incrementalBuiltHello = buildIncremental.mkIncrementalBuild patchedHello baseHelloArtifacts;
 
   incrementalBuiltHelloWithCheck = incrementalBuiltHello.overrideAttrs (old: {
     doCheck = true;
     checkPhase = ''
       echo "checking if unchanged source file is not recompiled"
-        [ "$(stat --format="%Y" lib/exitfail.o)" = "$(stat --format="%Y" ${baseHello.incrementalBuildArtifacts}/lib/exitfail.o)" ]
+        [ "$(stat --format="%Y" lib/exitfail.o)" = "$(stat --format="%Y" ${baseHelloArtifacts}/outputs/lib/exitfail.o)" ]
     '';
   });
 
-  baseHelloRemoveFile = buildIncremental.prepareIncrementalBuild (hello.overrideAttrs (old: {
+  baseHelloRemoveFileArtifacts = buildIncremental.prepareIncrementalBuild (hello.overrideAttrs (old: {
     patches = [ ./hello-additionalFile.patch ];
   }));
 
@@ -41,7 +41,7 @@ let
     '';
   });
 
-  incrementalBuiltHelloWithRemovedFile = buildIncremental.mkIncrementalBuild patchedHelloRemoveFile baseHelloRemoveFile.incrementalBuildArtifacts;
+  incrementalBuiltHelloWithRemovedFile = buildIncremental.mkIncrementalBuild patchedHelloRemoveFile baseHelloRemoveFileArtifacts;
 in
 stdenv.mkDerivation {
   name = "patched-hello-returns-correct-output";
diff --git a/pkgs/test/incrementalBuild/hello-additionalFile.patch b/pkgs/test/incrementalBuild/hello-additionalFile.patch
index 31fbe034909eb..345bc10ee49e5 100644
--- a/pkgs/test/incrementalBuild/hello-additionalFile.patch
+++ b/pkgs/test/incrementalBuild/hello-additionalFile.patch
@@ -1,25 +1,30 @@
+:100644 100644 0000000 0000000 M	Makefile.in
+:000000 100644 0000000 0000000 A	src/additionalFile.c
+:100644 100644 0000000 0000000 M	src/hello.c
+:100644 100644 0000000 0000000 M	src/system.h
+
 diff --git a/Makefile.in b/Makefile.in
-index 0805eda..77b000c 100644
+index 1597d39..f63f830 100644
 --- a/Makefile.in
 +++ b/Makefile.in
-@@ -227,7 +227,7 @@ am_lib_libhello_a_OBJECTS = lib/c-ctype.$(OBJEXT) \
- 	lib/quotearg.$(OBJEXT) lib/strnlen1.$(OBJEXT) \
- 	lib/unistd.$(OBJEXT) lib/wctype-h.$(OBJEXT) \
- 	lib/xmalloc.$(OBJEXT) lib/xalloc-die.$(OBJEXT) \
+@@ -312,7 +312,7 @@ am_lib_libhello_a_OBJECTS = lib/basename-lgpl.$(OBJEXT) \
+ 	lib/version-etc.$(OBJEXT) lib/version-etc-fsf.$(OBJEXT) \
+ 	lib/wctype-h.$(OBJEXT) lib/xmalloc.$(OBJEXT) \
+ 	lib/xalloc-die.$(OBJEXT) lib/xstriconv.$(OBJEXT) \
 -	lib/xstrndup.$(OBJEXT)
 +	lib/xstrndup.$(OBJEXT) src/additionalFile.$(OBJEXT)
  lib_libhello_a_OBJECTS = $(am_lib_libhello_a_OBJECTS)
- am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(infodir)" \
- 	"$(DESTDIR)$(man1dir)"
-@@ -1380,7 +1380,7 @@ lib_libhello_a_SOURCES = lib/c-ctype.h lib/c-ctype.c lib/c-strcase.h \
- 	lib/gettext.h lib/localcharset.h lib/localcharset.c \
- 	lib/progname.h lib/progname.c lib/quotearg.c lib/strnlen1.h \
- 	lib/strnlen1.c lib/unistd.c lib/wctype-h.c lib/xmalloc.c \
--	lib/xalloc-die.c lib/xstrndup.h lib/xstrndup.c
-+	lib/xalloc-die.c lib/xstrndup.h lib/xstrndup.c src/additionalFile.c
+ am_hello_OBJECTS = src/hello.$(OBJEXT)
+ hello_OBJECTS = $(am_hello_OBJECTS)
+@@ -1842,7 +1842,7 @@ lib_libhello_a_SOURCES = lib/basename-lgpl.c lib/c-ctype.h \
+ 	$(am__append_4) $(am__append_5) lib/version-etc.h \
+ 	lib/version-etc.c lib/version-etc-fsf.c lib/wctype-h.c \
+ 	lib/xmalloc.c lib/xalloc-die.c lib/xstriconv.h lib/xstriconv.c \
+-	lib/xstrndup.h lib/xstrndup.c
++	lib/xstrndup.h lib/xstrndup.c src/additionalFile.c
  lib_libhello_a_LIBADD = $(gl_LIBOBJS)
  lib_libhello_a_DEPENDENCIES = $(gl_LIBOBJS)
- EXTRA_lib_libhello_a_SOURCES = lib/stripslash.c lib/error.c \
+ EXTRA_lib_libhello_a_SOURCES = lib/close.c lib/stripslash.c lib/dup2.c \
 diff --git a/src/additionalFile.c b/src/additionalFile.c
 new file mode 100644
 index 0000000..34d683d
@@ -33,10 +38,10 @@ index 0000000..34d683d
 +    return 0;
 +}
 diff --git a/src/hello.c b/src/hello.c
-index 453962f..df67de2 100644
+index 2e7d38e..a8e36dc 100644
 --- a/src/hello.c
 +++ b/src/hello.c
-@@ -57,7 +57,11 @@ main (int argc, char *argv[])
+@@ -146,7 +146,11 @@ main (int argc, char *argv[])
  #endif
  
    /* Having initialized gettext, get the default message. */
@@ -50,12 +55,12 @@ index 453962f..df67de2 100644
    /* Even exiting has subtleties.  On exit, if any writes failed, change
       the exit status.  The /dev/full device on GNU/Linux can be used for
 diff --git a/src/system.h b/src/system.h
-index d1acac2..935b955 100644
+index d39cdb9..dc425d2 100644
 --- a/src/system.h
 +++ b/src/system.h
-@@ -42,4 +42,6 @@
- /* Check for errors on write.  */
- # include "closeout.h"
+@@ -59,4 +59,6 @@
+     } \
+   while (0)
  
 +int somefunc();
 +
diff --git a/pkgs/test/incrementalBuild/hello-removeFile.patch b/pkgs/test/incrementalBuild/hello-removeFile.patch
index 99ecf1e298bbb..2939790dabce1 100644
--- a/pkgs/test/incrementalBuild/hello-removeFile.patch
+++ b/pkgs/test/incrementalBuild/hello-removeFile.patch
@@ -1,25 +1,30 @@
+:100644 100644 0000000 0000000 M	Makefile.in
+:100644 000000 0000000 0000000 D	src/additionalFile.c
+:100644 100644 0000000 0000000 M	src/hello.c
+:100755 100755 0000000 0000000 M	tests/hello-1
+
 diff --git a/Makefile.in b/Makefile.in
-index 77b000c..0805eda 100644
+index f63f830..1597d39 100644
 --- a/Makefile.in
 +++ b/Makefile.in
-@@ -227,7 +227,7 @@ am_lib_libhello_a_OBJECTS = lib/c-ctype.$(OBJEXT) \
- 	lib/quotearg.$(OBJEXT) lib/strnlen1.$(OBJEXT) \
- 	lib/unistd.$(OBJEXT) lib/wctype-h.$(OBJEXT) \
- 	lib/xmalloc.$(OBJEXT) lib/xalloc-die.$(OBJEXT) \
+@@ -312,7 +312,7 @@ am_lib_libhello_a_OBJECTS = lib/basename-lgpl.$(OBJEXT) \
+ 	lib/version-etc.$(OBJEXT) lib/version-etc-fsf.$(OBJEXT) \
+ 	lib/wctype-h.$(OBJEXT) lib/xmalloc.$(OBJEXT) \
+ 	lib/xalloc-die.$(OBJEXT) lib/xstriconv.$(OBJEXT) \
 -	lib/xstrndup.$(OBJEXT) src/additionalFile.$(OBJEXT)
 +	lib/xstrndup.$(OBJEXT)
  lib_libhello_a_OBJECTS = $(am_lib_libhello_a_OBJECTS)
- am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(infodir)" \
- 	"$(DESTDIR)$(man1dir)"
-@@ -1380,7 +1380,7 @@ lib_libhello_a_SOURCES = lib/c-ctype.h lib/c-ctype.c lib/c-strcase.h \
- 	lib/gettext.h lib/localcharset.h lib/localcharset.c \
- 	lib/progname.h lib/progname.c lib/quotearg.c lib/strnlen1.h \
- 	lib/strnlen1.c lib/unistd.c lib/wctype-h.c lib/xmalloc.c \
--	lib/xalloc-die.c lib/xstrndup.h lib/xstrndup.c src/additionalFile.c
-+	lib/xalloc-die.c lib/xstrndup.h lib/xstrndup.c
+ am_hello_OBJECTS = src/hello.$(OBJEXT)
+ hello_OBJECTS = $(am_hello_OBJECTS)
+@@ -1842,7 +1842,7 @@ lib_libhello_a_SOURCES = lib/basename-lgpl.c lib/c-ctype.h \
+ 	$(am__append_4) $(am__append_5) lib/version-etc.h \
+ 	lib/version-etc.c lib/version-etc-fsf.c lib/wctype-h.c \
+ 	lib/xmalloc.c lib/xalloc-die.c lib/xstriconv.h lib/xstriconv.c \
+-	lib/xstrndup.h lib/xstrndup.c src/additionalFile.c
++	lib/xstrndup.h lib/xstrndup.c
  lib_libhello_a_LIBADD = $(gl_LIBOBJS)
  lib_libhello_a_DEPENDENCIES = $(gl_LIBOBJS)
- EXTRA_lib_libhello_a_SOURCES = lib/stripslash.c lib/error.c \
+ EXTRA_lib_libhello_a_SOURCES = lib/close.c lib/stripslash.c lib/dup2.c \
 diff --git a/src/additionalFile.c b/src/additionalFile.c
 deleted file mode 100644
 index 34d683d..0000000
@@ -33,12 +38,12 @@ index 34d683d..0000000
 -    return 0;
 -}
 diff --git a/src/hello.c b/src/hello.c
-index df67de2..768285a 100644
+index a8e36dc..53722d9 100644
 --- a/src/hello.c
 +++ b/src/hello.c
-@@ -36,6 +36,10 @@ static const struct option longopts[] = {
- static void print_help (void);
- static void print_version (void);
+@@ -126,6 +126,10 @@ parse_options (int argc, char *argv[], const char **greeting_msg)
+     }
+ }
  
 +int somefunc() {
 +    return 1;
@@ -48,7 +53,7 @@ index df67de2..768285a 100644
  main (int argc, char *argv[])
  {
 diff --git a/tests/hello-1 b/tests/hello-1
-index e15fa95..3b7a815 100755
+index 96ffef8..f0b9f8d 100755
 --- a/tests/hello-1
 +++ b/tests/hello-1
 @@ -21,7 +21,7 @@ export LANGUAGE LC_ALL LC_MESSAGES LANG