Project import generated by Copybara.
NOKEYCHECK=True
GitOrigin-RevId: 1eeb6ef24f8748b99e62834cf4ec8f41d7d181b3
diff --git a/memtester.patches/memtester-50.patch b/memtester.patches/memtester-50.patch
new file mode 100644
index 0000000..aa14a36
--- /dev/null
+++ b/memtester.patches/memtester-50.patch
@@ -0,0 +1,35 @@
+diff -aruN a/Makefile b/Makefile
+--- a/Makefile 2010-10-03 12:56:13.000000000 -0700
++++ b/Makefile 2010-11-02 17:21:36.093700129 -0700
+@@ -7,11 +7,8 @@
+ # COPYING for details.
+ #
+
+-# You don't need to edit these; change the contents of the conf-cc and conf-ld
+-# files if you need to change the compile/link commands. See the README for
+-# more information.
+-CC = $(shell head -n 1 conf-cc)
+-LD = $(shell head -n 1 conf-ld)
++compile = $(CC) -O2 -DPOSIX -D_POSIX_C_SOURCE=200809L -D_FILE_OFFSET_BITS=64 -DTEST_NARROW_WRITES -c
++link = $(CC) -o
+
+ SOURCES = memtester.c tests.c
+ OBJECTS = $(SOURCES:.c=.o)
+@@ -74,11 +71,11 @@
+ rm -f memtester $(TARGETS) $(OBJECTS) core
+
+ memtester: \
+-$(OBJECTS) memtester.c tests.h tests.c tests.h conf-cc Makefile load extra-libs
+- ./load memtester tests.o `cat extra-libs`
++$(OBJECTS) memtester.c tests.h tests.c tests.h Makefile
++ $(link) memtester memtester.o tests.o
+
+-memtester.o: memtester.c tests.h conf-cc Makefile compile
+- ./compile memtester.c
++memtester.o: memtester.c tests.h Makefile
++ $(compile) memtester.c
+
+-tests.o: tests.c tests.h conf-cc Makefile compile
+- ./compile tests.c
++tests.o: tests.c tests.h Makefile
++ $(compile) tests.c
diff --git a/memtester.patches/memtester-51.patch b/memtester.patches/memtester-51.patch
new file mode 100644
index 0000000..77e5bd7
--- /dev/null
+++ b/memtester.patches/memtester-51.patch
@@ -0,0 +1,13 @@
+diff -aruN a/Makefile b/Makefile
+--- a/Makefile 2012-09-10 15:51:24.061610646 -0700
++++ b/Makefile 2012-09-10 15:51:02.872463701 -0700
+@@ -22,7 +22,8 @@
+ all: memtester
+
+ install: all
+- mkdir -m 755 -p $(INSTALLPATH)/{bin,man/man8}
++ mkdir -m 755 -p $(INSTALLPATH)/bin
++ mkdir -m 755 -p $(INSTALLPATH)/man/man8
+ install -m 755 memtester $(INSTALLPATH)/bin/
+ gzip -c memtester.8 >memtester.8.gz ; install -m 644 memtester.8.gz $(INSTALLPATH)/man/man8/
+
diff --git a/memtester.patches/memtester-52.patch b/memtester.patches/memtester-52.patch
new file mode 100644
index 0000000..fd54ba7
--- /dev/null
+++ b/memtester.patches/memtester-52.patch
@@ -0,0 +1,66 @@
+diff -aruN a/memtester.c b/memtester.c
+--- a/memtester.c 2017-04-13 12:13:53.101455795 -0700
++++ b/memtester.c 2017-04-13 12:21:38.423324655 -0700
+@@ -100,7 +100,9 @@
+
+ /* Function definitions */
+ void usage(char *me) {
+- fprintf(stderr, "\nUsage: %s [-p physaddrbase] <mem>[B|K|M|G] [loops]\n", me);
++ fprintf(stderr, "\nUsage: %s [-e] [-p physaddrbase] <mem>[B|K|M|G] [loops]\n", me);
++ fprintf(stderr, "Arguments:\n");
++ fprintf(stderr, " -e Exit on error.\n");
+ exit(EXIT_FAIL_NONSTARTER);
+ }
+
+@@ -113,6 +115,7 @@
+ void volatile *buf, *aligned;
+ ulv *bufa, *bufb;
+ int do_mlock = 1, done_mem = 0;
++ int exit_on_err = 0;
+ int exit_code = 0;
+ int memfd, opt, memshift;
+ size_t maxbytes = -1; /* addressable memory, in bytes */
+@@ -127,7 +130,7 @@
+ pagesizemask = (ptrdiff_t) ~(pagesize - 1);
+ printf("pagesizemask is 0x%tx\n", pagesizemask);
+
+- while ((opt = getopt(argc, argv, "p:")) != -1) {
++ while ((opt = getopt(argc, argv, "ep:")) != -1) {
+ switch (opt) {
+ case 'p':
+ errno = 0;
+@@ -154,6 +157,9 @@
+ /* okay, got address */
+ use_phys = 1;
+ break;
++ case 'e':
++ exit_on_err = 1;
++ break;
+ default: /* '?' */
+ usage(argv[0]); /* doesn't return */
+ }
+@@ -322,6 +328,7 @@
+ if (!test_stuck_address(aligned, bufsize / sizeof(ul))) {
+ printf("ok\n");
+ } else {
++ printf("fail\n");
+ exit_code |= EXIT_FAIL_ADDRESSLINES;
+ }
+ for (i=0;;i++) {
+@@ -330,12 +337,16 @@
+ if (!tests[i].fp(bufa, bufb, count)) {
+ printf("ok\n");
+ } else {
++ printf("fail\n");
+ exit_code |= EXIT_FAIL_OTHERTEST;
+ }
+ fflush(stdout);
+ }
+ printf("\n");
+ fflush(stdout);
++ if (exit_on_err && (exit_code != 0)) {
++ break;
++ }
+ }
+ if (do_mlock) munlock((void *) aligned, bufsize);
+ printf("Done.\n");
diff --git a/memtester.tar.gz b/memtester.tar.gz
new file mode 100644
index 0000000..ca21e55
--- /dev/null
+++ b/memtester.tar.gz
Binary files differ
diff --git a/memtester.url b/memtester.url
new file mode 100644
index 0000000..333eb54
--- /dev/null
+++ b/memtester.url
@@ -0,0 +1 @@
+http://pyropus.ca/software/memtester/old-versions/memtester-4.2.1.tar.gz
diff --git a/memtester.version b/memtester.version
new file mode 100644
index 0000000..fae6e3d
--- /dev/null
+++ b/memtester.version
@@ -0,0 +1 @@
+4.2.1