trackler 2.2.1.69 → 2.2.1.70

Sign up to get free protection for your applications and to get access to all the features.
Files changed (73) hide show
  1. checksums.yaml +4 -4
  2. data/lib/trackler/version.rb +1 -1
  3. data/problem-specifications/exercises/isbn-verifier/description.md +25 -20
  4. data/tracks/c/bin/run-tests +1 -2
  5. data/tracks/c/exercises/acronym/makefile +10 -0
  6. data/tracks/c/exercises/all-your-base/makefile +10 -0
  7. data/tracks/c/exercises/allergies/makefile +10 -0
  8. data/tracks/c/exercises/anagram/makefile +9 -0
  9. data/tracks/c/exercises/atbash-cipher/makefile +9 -0
  10. data/tracks/c/exercises/beer-song/makefile +9 -0
  11. data/tracks/c/exercises/binary/makefile +9 -0
  12. data/tracks/c/exercises/binary-search/makefile +9 -0
  13. data/tracks/c/exercises/bob/makefile +9 -0
  14. data/tracks/c/exercises/clock/makefile +9 -0
  15. data/tracks/c/exercises/collatz-conjecture/makefile +10 -0
  16. data/tracks/c/exercises/difference-of-squares/makefile +9 -0
  17. data/tracks/c/exercises/gigasecond/makefile +9 -0
  18. data/tracks/c/exercises/grains/makefile +9 -0
  19. data/tracks/c/exercises/hamming/makefile +9 -0
  20. data/tracks/c/exercises/isogram/makefile +10 -0
  21. data/tracks/c/exercises/largest-series-product/makefile +9 -0
  22. data/tracks/c/exercises/leap/makefile +9 -0
  23. data/tracks/c/exercises/meetup/makefile +10 -0
  24. data/tracks/c/exercises/nth-prime/makefile +9 -0
  25. data/tracks/c/exercises/nucleotide-count/makefile +10 -0
  26. data/tracks/c/exercises/palindrome-products/makefile +9 -0
  27. data/tracks/c/exercises/pangram/makefile +9 -0
  28. data/tracks/c/exercises/pascals-triangle/makefile +9 -0
  29. data/tracks/c/exercises/perfect-numbers/makefile +8 -0
  30. data/tracks/c/exercises/phone-number/makefile +9 -0
  31. data/tracks/c/exercises/queen-attack/makefile +10 -0
  32. data/tracks/c/exercises/raindrops/makefile +9 -0
  33. data/tracks/c/exercises/react/makefile +9 -0
  34. data/tracks/c/exercises/rna-transcription/makefile +10 -0
  35. data/tracks/c/exercises/robot-simulator/makefile +9 -0
  36. data/tracks/c/exercises/roman-numerals/makefile +9 -0
  37. data/tracks/c/exercises/scrabble-score/makefile +9 -0
  38. data/tracks/c/exercises/series/makefile +9 -0
  39. data/tracks/c/exercises/sieve/makefile +10 -0
  40. data/tracks/c/exercises/space-age/makefile +9 -0
  41. data/tracks/c/exercises/sublist/makefile +10 -0
  42. data/tracks/c/exercises/sum-of-multiples/makefile +10 -0
  43. data/tracks/c/exercises/triangle/makefile +9 -0
  44. data/tracks/c/exercises/word-count/makefile +9 -0
  45. data/tracks/delphi/config.json +10 -0
  46. data/tracks/delphi/exercises/reverse-string/README.md +34 -0
  47. data/tracks/delphi/exercises/reverse-string/ReverseString.dpr +60 -0
  48. data/tracks/delphi/exercises/reverse-string/uReverseStringExample.pas +18 -0
  49. data/tracks/delphi/exercises/reverse-string/uReverseStringTests.pas +69 -0
  50. data/tracks/fsharp/exercises/forth/Example.fs +29 -25
  51. data/tracks/fsharp/exercises/forth/ForthTest.fs +190 -74
  52. data/tracks/fsharp/exercises/markdown/MarkdownTest.fs +6 -3
  53. data/tracks/fsharp/generators/Exercise.fs +4 -4
  54. data/tracks/fsharp/generators/Generators.fs +29 -1
  55. data/tracks/java/exercises/allergies/.meta/src/reference/java/Allergen.java +2 -2
  56. data/tracks/java/exercises/allergies/.meta/src/reference/java/Allergies.java +4 -4
  57. data/tracks/java/exercises/allergies/src/main/java/Allergen.java +2 -2
  58. data/tracks/java/exercises/anagram/.meta/src/reference/java/Anagram.java +5 -5
  59. data/tracks/java/exercises/bob/.meta/src/reference/java/Bob.java +8 -5
  60. data/tracks/java/exercises/kindergarten-garden/src/main/java/KindergartenGarden.java +17 -0
  61. data/tracks/java/exercises/nth-prime/src/main/java/PrimeCalculator.java +7 -0
  62. data/tracks/java/exercises/rotational-cipher/src/main/java/RotationalCipher.java +11 -0
  63. data/tracks/javascript/config.json +15 -0
  64. data/tracks/javascript/exercises/connect/README.md +59 -0
  65. data/tracks/javascript/exercises/connect/connect.spec.js +108 -0
  66. data/tracks/javascript/exercises/connect/example.js +105 -0
  67. data/tracks/kotlin/README.md +1 -1
  68. data/tracks/kotlin/exercises/hello-world/TUTORIAL.md +2 -2
  69. metadata +12 -6
  70. data/tracks/java/exercises/book-store/.meta/src/reference/java/.keep +0 -0
  71. data/tracks/java/exercises/nth-prime/src/main/java/.keep +0 -0
  72. data/tracks/java/exercises/rotational-cipher/src/main/java/.keep +0 -0
  73. data/tracks/javascript/package-lock.json +0 -1895
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c900f215603f2847b56ef3c2542264b3623c134a
4
- data.tar.gz: 9cee0a9156eace5beff7d34a075513d00b956307
3
+ metadata.gz: db1dac190572a67ad1c9066086bc27f651d43512
4
+ data.tar.gz: e7f6a561bcfec5e8f015f3f234592119a786764f
5
5
  SHA512:
6
- metadata.gz: f04eed61e824d8cfdcc8baa814ca910ef02348c106ab2fe518778458eada7dc50d70d9ee816bd9553891e9088ddc50aa9d4f2a526c41cbeddf58d838064c9a4f
7
- data.tar.gz: 1a2cbfd9bbb5c12dcdcfce7aaf8577cbc20732ba6eaaa143cdd52351cc044ef7682cf450dbbc8e948c1ac0c167066502b3584c380297ab5a3d376e60e368aa99
6
+ metadata.gz: d881520b55a7e22887cb9cf931583c9d84db97deda9bbe370ab89a3ae2ff9782cd05f31947246fa2874803229c0a54fc87126488ed5b011ed232fac9127d4929
7
+ data.tar.gz: 970a8aed655deaf30103ccf71a6891350aefbad2263c4e5f9950e753b3e8fa55dcccaf79083db80fcab3a69e253ddb57dff30b79242e5c546841d9d3170691a1
@@ -1,3 +1,3 @@
1
1
  module Trackler
2
- VERSION = "2.2.1.69"
2
+ VERSION = "2.2.1.70"
3
3
  end
@@ -1,35 +1,40 @@
1
- Check if a given ISBN-10 is valid.
1
+ The [ISBN-10 verification process](https://en.wikipedia.org/wiki/International_Standard_Book_Number) is used to validate book identification
2
+ numbers. These normally contain dashes and look like: `3-598-21508-8`
2
3
 
3
- ## Functionality
4
+ ## ISBN
4
5
 
5
- Given an unknown string the program should check if the provided string is a valid ISBN-10.
6
- Putting this into place requires some thinking about preprocessing/parsing of the string prior to calculating the check digit for the ISBN.
6
+ The ISBN-10 format is 9 digits (0 to 9) plus one check character (either a digit or an X only). In the case the check character is an X, this represents the value '10'. These may be communicated with or without hyphens, and can be checked for their validity by the following formula:
7
7
 
8
- The program should allow for ISBN-10 without the separating dashes to be verified as well.
8
+ ```
9
+ (x1 * 10 + x2 * 9 + x3 * 8 + x4 * 7 + x5 * 6 + x6 * 5 + x7 * 4 + x8 * 3 + x9 * 2 + x10 * 1) mod 11 == 0
10
+ ```
9
11
 
10
- ## ISBN
12
+ If the result is 0, then it is a valid ISBN-10, otherwise it is invalid.
13
+
14
+ ## Example
11
15
 
12
- Let's take a random ISBN-10 number, say `3-598-21508-8` for this.
13
- The first digit block indicates the group where the ISBN belongs. Groups can consist of shared languages, geographic regions or countries. The leading '3' signals this ISBN is from a german speaking country.
14
- The following number block is to identify the publisher. Since this is a three digit publisher number there is a 5 digit title number for this book.
15
- The last digit in the ISBN is the check digit which is used to detect read errors.
16
+ Let's take the ISBN-10 `3-598-21508-8`. We plug it in to the formula, and get:
17
+ ```
18
+ (3 * 10 + 5 * 9 + 9 * 8 + 8 * 7 + 2 * 6 + 1 * 5 + 5 * 4 + 0 * 3 + 8 * 2 + 8 * 1) mod 11 == 0
19
+ ```
16
20
 
17
- The first 9 digits in the ISBN have to be between 0 and 9.
18
- The check digit can additionally be an 'X' to allow 10 to be a valid check digit as well.
21
+ Since the result is 0, this proves that our ISBN is valid.
22
+
23
+ ## Task
24
+
25
+ Given a string the program should check if the provided string is a valid ISBN-10.
26
+ Putting this into place requires some thinking about preprocessing/parsing of the string prior to calculating the check digit for the ISBN.
19
27
 
20
- A valid ISBN-10 is calculated with this formula `(x1 * 10 + x2 * 9 + x3 * 8 + x4 * 7 + x5 * 6 + x6 * 5 + x7 * 4 + x8 * 3 + x9 * 2 + x10 * 1) mod 11 == 0`
21
- So for our example ISBN this means:
22
- (3 * 10 + 5 * 9 + 9 * 8 + 8 * 7 + 2 * 6 + 1 * 5 + 5 * 4 + 0 * 3 + 8 * 2 + 8 * 1) mod 11 = 0
28
+ The program should be able to verify ISBN-10 both with and without separating dashes.
23
29
 
24
- Which proves that the ISBN is valid.
25
30
 
26
31
  ## Caveats
27
32
 
28
- Converting from string to number can be tricky in certain languages.
29
- It's getting even trickier since the check-digit of an ISBN-10 can be 'X'.
33
+ Converting from strings to numbers can be tricky in certain languages.
34
+ Now, it's even trickier since the check digit of an ISBN-10 may be 'X' (representing '10'). For instance `3-598-21507-X` is a valid ISBN-10.
30
35
 
31
36
  ## Bonus tasks
32
37
 
33
- * Generate a valid ISBN-13 from the input ISBN-10 (and maybe verify it again with a derived verifier)
38
+ * Generate a valid ISBN-13 from the input ISBN-10 (and maybe verify it again with a derived verifier).
34
39
 
35
- * Generate valid ISBN, maybe even from a given starting ISBN
40
+ * Generate valid ISBN, maybe even from a given starting ISBN.
@@ -28,12 +28,11 @@ for D in exercises/*; do
28
28
  { cd ${D};
29
29
  echo "Running tests for ${EXERCISE_NAME}";
30
30
  make clean >> /dev/null;
31
- if make | grep FAIL: ; then
31
+ if make memcheck | grep FAIL: ; then
32
32
  exit 1
33
33
  elif [ ${PIPESTATUS[0]} -ne 0 ]; then
34
34
  exit 1
35
35
  fi
36
- valgrind --quiet --leak-check=full --error-exitcode=1 ./tests.out >> /dev/null;
37
36
  cd ${CURRENT_DIR};
38
37
  }
39
38
  fi
@@ -1,12 +1,22 @@
1
1
  CFLAGS = -std=c99
2
+ CFLAGS += -g
2
3
  CFLAGS += -Wall
3
4
  CFLAGS += -Wextra
4
5
  CFLAGS += -pedantic
5
6
  CFLAGS += -Werror
6
7
 
8
+ VFLAGS = --quiet
9
+ VFLAGS += --tool=memcheck
10
+ VFLAGS += --leak-check=full
11
+ VFLAGS += --error-exitcode=1
12
+
7
13
  test: tests.out
8
14
  @./tests.out
9
15
 
16
+ memcheck: tests.out
17
+ @valgrind $(VFLAGS) ./tests.out
18
+ @echo "Memory check passed"
19
+
10
20
  clean:
11
21
  rm -f *.o *.out
12
22
 
@@ -1,12 +1,22 @@
1
1
  CFLAGS = -std=c99
2
+ CFLAGS += -g
2
3
  CFLAGS += -Wall
3
4
  CFLAGS += -Wextra
4
5
  CFLAGS += -pedantic
5
6
  CFLAGS += -Werror
6
7
 
8
+ VFLAGS = --quiet
9
+ VFLAGS += --tool=memcheck
10
+ VFLAGS += --leak-check=full
11
+ VFLAGS += --error-exitcode=1
12
+
7
13
  test: tests.out
8
14
  @./tests.out
9
15
 
16
+ memcheck: tests.out
17
+ @valgrind $(VFLAGS) ./tests.out
18
+ @echo "Memory check passed"
19
+
10
20
  clean:
11
21
  rm -f *.o *.out
12
22
 
@@ -1,12 +1,22 @@
1
1
  CFLAGS = -std=c99
2
+ CFLAGS += -g
2
3
  CFLAGS += -Wall
3
4
  CFLAGS += -Wextra
4
5
  CFLAGS += -pedantic
5
6
  CFLAGS += -Werror
6
7
 
8
+ VFLAGS = --quiet
9
+ VFLAGS += --tool=memcheck
10
+ VFLAGS += --leak-check=full
11
+ VFLAGS += --error-exitcode=1
12
+
7
13
  test: tests.out
8
14
  @./tests.out
9
15
 
16
+ memcheck: tests.out
17
+ @valgrind $(VFLAGS) ./tests.out
18
+ @echo "Memory check passed"
19
+
10
20
  clean:
11
21
  rm -f *.o *.out
12
22
 
@@ -1,13 +1,22 @@
1
1
  CFLAGS = -std=c99
2
+ CFLAGS += -g
2
3
  CFLAGS += -Wall
3
4
  CFLAGS += -Wextra
4
5
  CFLAGS += -pedantic
5
6
  CFLAGS += -Werror
6
7
 
8
+ VFLAGS = --quiet
9
+ VFLAGS += --tool=memcheck
10
+ VFLAGS += --leak-check=full
11
+ VFLAGS += --error-exitcode=1
7
12
 
8
13
  test: tests.out
9
14
  @./tests.out
10
15
 
16
+ memcheck: tests.out
17
+ @valgrind $(VFLAGS) ./tests.out
18
+ @echo "Memory check passed"
19
+
11
20
  clean:
12
21
  rm -f *.o *.out
13
22
 
@@ -1,13 +1,22 @@
1
1
  CFLAGS = -std=c99
2
+ CFLAGS += -g
2
3
  CFLAGS += -Wall
3
4
  CFLAGS += -Wextra
4
5
  CFLAGS += -pedantic
5
6
  CFLAGS += -Werror
6
7
 
8
+ VFLAGS = --quiet
9
+ VFLAGS += --tool=memcheck
10
+ VFLAGS += --leak-check=full
11
+ VFLAGS += --error-exitcode=1
7
12
 
8
13
  test: tests.out
9
14
  @./tests.out
10
15
 
16
+ memcheck: tests.out
17
+ @valgrind $(VFLAGS) ./tests.out
18
+ @echo "Memory check passed"
19
+
11
20
  clean:
12
21
  rm -f *.o *.out
13
22
 
@@ -1,13 +1,22 @@
1
1
  CFLAGS = -std=c99
2
+ CFLAGS += -g
2
3
  CFLAGS += -Wall
3
4
  CFLAGS += -Wextra
4
5
  CFLAGS += -pedantic
5
6
  CFLAGS += -Werror
6
7
 
8
+ VFLAGS = --quiet
9
+ VFLAGS += --tool=memcheck
10
+ VFLAGS += --leak-check=full
11
+ VFLAGS += --error-exitcode=1
7
12
 
8
13
  test: tests.out
9
14
  @./tests.out
10
15
 
16
+ memcheck: tests.out
17
+ @valgrind $(VFLAGS) ./tests.out
18
+ @echo "Memory check passed"
19
+
11
20
  clean:
12
21
  rm -f *.o *.out
13
22
 
@@ -1,13 +1,22 @@
1
1
  CFLAGS = -std=c99
2
+ CFLAGS += -g
2
3
  CFLAGS += -Wall
3
4
  CFLAGS += -Wextra
4
5
  CFLAGS += -pedantic
5
6
  CFLAGS += -Werror
6
7
 
8
+ VFLAGS = --quiet
9
+ VFLAGS += --tool=memcheck
10
+ VFLAGS += --leak-check=full
11
+ VFLAGS += --error-exitcode=1
7
12
 
8
13
  test: tests.out
9
14
  @./tests.out
10
15
 
16
+ memcheck: tests.out
17
+ @valgrind $(VFLAGS) ./tests.out
18
+ @echo "Memory check passed"
19
+
11
20
  clean:
12
21
  rm -f *.o *.out
13
22
 
@@ -1,13 +1,22 @@
1
1
  CFLAGS = -std=c99
2
+ CFLAGS += -g
2
3
  CFLAGS += -Wall
3
4
  CFLAGS += -Wextra
4
5
  CFLAGS += -pedantic
5
6
  CFLAGS += -Werror
6
7
 
8
+ VFLAGS = --quiet
9
+ VFLAGS += --tool=memcheck
10
+ VFLAGS += --leak-check=full
11
+ VFLAGS += --error-exitcode=1
7
12
 
8
13
  test: tests.out
9
14
  @./tests.out
10
15
 
16
+ memcheck: tests.out
17
+ @valgrind $(VFLAGS) ./tests.out
18
+ @echo "Memory check passed"
19
+
11
20
  clean:
12
21
  rm -f *.o *.out
13
22
 
@@ -1,13 +1,22 @@
1
1
  CFLAGS = -std=c99
2
+ CFLAGS += -g
2
3
  CFLAGS += -Wall
3
4
  CFLAGS += -Wextra
4
5
  CFLAGS += -pedantic
5
6
  CFLAGS += -Werror
6
7
 
8
+ VFLAGS = --quiet
9
+ VFLAGS += --tool=memcheck
10
+ VFLAGS += --leak-check=full
11
+ VFLAGS += --error-exitcode=1
7
12
 
8
13
  test: tests.out
9
14
  @./tests.out
10
15
 
16
+ memcheck: tests.out
17
+ @valgrind $(VFLAGS) ./tests.out
18
+ @echo "Memory check passed"
19
+
11
20
  clean:
12
21
  rm -f *.o *.out
13
22
 
@@ -1,13 +1,22 @@
1
1
  CFLAGS = -std=c99
2
+ CFLAGS += -g
2
3
  CFLAGS += -Wall
3
4
  CFLAGS += -Wextra
4
5
  CFLAGS += -pedantic
5
6
  CFLAGS += -Werror
6
7
 
8
+ VFLAGS = --quiet
9
+ VFLAGS += --tool=memcheck
10
+ VFLAGS += --leak-check=full
11
+ VFLAGS += --error-exitcode=1
7
12
 
8
13
  test: tests.out
9
14
  @./tests.out
10
15
 
16
+ memcheck: tests.out
17
+ @valgrind $(VFLAGS) ./tests.out
18
+ @echo "Memory check passed"
19
+
11
20
  clean:
12
21
  rm -f *.o *.out
13
22
 
@@ -1,12 +1,22 @@
1
1
  CFLAGS = -std=c99
2
+ CFLAGS += -g
2
3
  CFLAGS += -Wall
3
4
  CFLAGS += -Wextra
4
5
  CFLAGS += -pedantic
5
6
  CFLAGS += -Werror
6
7
 
8
+ VFLAGS = --quiet
9
+ VFLAGS += --tool=memcheck
10
+ VFLAGS += --leak-check=full
11
+ VFLAGS += --error-exitcode=1
12
+
7
13
  test: tests.out
8
14
  @./tests.out
9
15
 
16
+ memcheck: tests.out
17
+ @valgrind $(VFLAGS) ./tests.out
18
+ @echo "Memory check passed"
19
+
10
20
  clean:
11
21
  rm -f *.o *.out
12
22
 
@@ -1,13 +1,22 @@
1
1
  CFLAGS = -std=c99
2
+ CFLAGS += -g
2
3
  CFLAGS += -Wall
3
4
  CFLAGS += -Wextra
4
5
  CFLAGS += -pedantic
5
6
  CFLAGS += -Werror
6
7
 
8
+ VFLAGS = --quiet
9
+ VFLAGS += --tool=memcheck
10
+ VFLAGS += --leak-check=full
11
+ VFLAGS += --error-exitcode=1
7
12
 
8
13
  test: tests.out
9
14
  @./tests.out
10
15
 
16
+ memcheck: tests.out
17
+ @valgrind $(VFLAGS) ./tests.out
18
+ @echo "Memory check passed"
19
+
11
20
  clean:
12
21
  rm -f *.o *.out
13
22
 
@@ -1,13 +1,22 @@
1
1
  CFLAGS = -std=c99
2
+ CFLAGS += -g
2
3
  CFLAGS += -Wall
3
4
  CFLAGS += -Wextra
4
5
  CFLAGS += -pedantic
5
6
  CFLAGS += -Werror
6
7
 
8
+ VFLAGS = --quiet
9
+ VFLAGS += --tool=memcheck
10
+ VFLAGS += --leak-check=full
11
+ VFLAGS += --error-exitcode=1
7
12
 
8
13
  test: tests.out
9
14
  @./tests.out
10
15
 
16
+ memcheck: tests.out
17
+ @valgrind $(VFLAGS) ./tests.out
18
+ @echo "Memory check passed"
19
+
11
20
  clean:
12
21
  rm -f *.o *.out
13
22
 
@@ -1,13 +1,22 @@
1
1
  CFLAGS = -std=c99
2
+ CFLAGS += -g
2
3
  CFLAGS += -Wall
3
4
  CFLAGS += -Wextra
4
5
  CFLAGS += -pedantic
5
6
  CFLAGS += -Werror
6
7
 
8
+ VFLAGS = --quiet
9
+ VFLAGS += --tool=memcheck
10
+ VFLAGS += --leak-check=full
11
+ VFLAGS += --error-exitcode=1
7
12
 
8
13
  test: tests.out
9
14
  @./tests.out
10
15
 
16
+ memcheck: tests.out
17
+ @valgrind $(VFLAGS) ./tests.out
18
+ @echo "Memory check passed"
19
+
11
20
  clean:
12
21
  rm -f *.o *.out
13
22
 
@@ -1,13 +1,22 @@
1
1
  CFLAGS = -std=c99
2
+ CFLAGS += -g
2
3
  CFLAGS += -Wall
3
4
  CFLAGS += -Wextra
4
5
  CFLAGS += -pedantic
5
6
  CFLAGS += -Werror
6
7
 
8
+ VFLAGS = --quiet
9
+ VFLAGS += --tool=memcheck
10
+ VFLAGS += --leak-check=full
11
+ VFLAGS += --error-exitcode=1
7
12
 
8
13
  test: tests.out
9
14
  @./tests.out
10
15
 
16
+ memcheck: tests.out
17
+ @valgrind $(VFLAGS) ./tests.out
18
+ @echo "Memory check passed"
19
+
11
20
  clean:
12
21
  rm -f *.o *.out
13
22
 
@@ -1,12 +1,22 @@
1
1
  CFLAGS = -std=c99
2
+ CFLAGS += -g
2
3
  CFLAGS += -Wall
3
4
  CFLAGS += -Wextra
4
5
  CFLAGS += -pedantic
5
6
  CFLAGS += -Werror
6
7
 
8
+ VFLAGS = --quiet
9
+ VFLAGS += --tool=memcheck
10
+ VFLAGS += --leak-check=full
11
+ VFLAGS += --error-exitcode=1
12
+
7
13
  test: tests.out
8
14
  @./tests.out
9
15
 
16
+ memcheck: tests.out
17
+ @valgrind $(VFLAGS) ./tests.out
18
+ @echo "Memory check passed"
19
+
10
20
  clean:
11
21
  rm -f *.o *.out
12
22
 
@@ -1,13 +1,22 @@
1
1
  CFLAGS = -std=c99
2
+ CFLAGS += -g
2
3
  CFLAGS += -Wall
3
4
  CFLAGS += -Wextra
4
5
  CFLAGS += -pedantic
5
6
  CFLAGS += -Werror
6
7
 
8
+ VFLAGS = --quiet
9
+ VFLAGS += --tool=memcheck
10
+ VFLAGS += --leak-check=full
11
+ VFLAGS += --error-exitcode=1
7
12
 
8
13
  test: tests.out
9
14
  @./tests.out
10
15
 
16
+ memcheck: tests.out
17
+ @valgrind $(VFLAGS) ./tests.out
18
+ @echo "Memory check passed"
19
+
11
20
  clean:
12
21
  rm -f *.o *.out
13
22
 
@@ -1,13 +1,22 @@
1
1
  CFLAGS = -std=c99
2
+ CFLAGS += -g
2
3
  CFLAGS += -Wall
3
4
  CFLAGS += -Wextra
4
5
  CFLAGS += -pedantic
5
6
  CFLAGS += -Werror
6
7
 
8
+ VFLAGS = --quiet
9
+ VFLAGS += --tool=memcheck
10
+ VFLAGS += --leak-check=full
11
+ VFLAGS += --error-exitcode=1
7
12
 
8
13
  test: tests.out
9
14
  @./tests.out
10
15
 
16
+ memcheck: tests.out
17
+ @valgrind $(VFLAGS) ./tests.out
18
+ @echo "Memory check passed"
19
+
11
20
  clean:
12
21
  rm -f *.o *.out
13
22
 
@@ -1,12 +1,22 @@
1
1
  CFLAGS = -std=c99
2
+ CFLAGS += -g
2
3
  CFLAGS += -Wall
3
4
  CFLAGS += -Wextra
4
5
  CFLAGS += -pedantic
5
6
  CFLAGS += -Werror
6
7
 
8
+ VFLAGS = --quiet
9
+ VFLAGS += --tool=memcheck
10
+ VFLAGS += --leak-check=full
11
+ VFLAGS += --error-exitcode=1
12
+
7
13
  test: tests.out
8
14
  @./tests.out
9
15
 
16
+ memcheck: tests.out
17
+ @valgrind $(VFLAGS) ./tests.out
18
+ @echo "Memory check passed"
19
+
10
20
  clean:
11
21
  rm -f *.o *.out
12
22
 
@@ -1,13 +1,22 @@
1
1
  CFLAGS = -std=c99
2
+ CFLAGS += -g
2
3
  CFLAGS += -Wall
3
4
  CFLAGS += -Wextra
4
5
  CFLAGS += -pedantic
5
6
  CFLAGS += -Werror
6
7
 
8
+ VFLAGS = --quiet
9
+ VFLAGS += --tool=memcheck
10
+ VFLAGS += --leak-check=full
11
+ VFLAGS += --error-exitcode=1
7
12
 
8
13
  test: tests.out
9
14
  @./tests.out
10
15
 
16
+ memcheck: tests.out
17
+ @valgrind $(VFLAGS) ./tests.out
18
+ @echo "Memory check passed"
19
+
11
20
  clean:
12
21
  rm -f *.o *.out
13
22
 
@@ -1,12 +1,22 @@
1
1
  CFLAGS = -std=c99
2
+ CFLAGS += -g
2
3
  CFLAGS += -Wall
3
4
  CFLAGS += -Wextra
4
5
  CFLAGS += -pedantic
5
6
  CFLAGS += -Werror
6
7
 
8
+ VFLAGS = --quiet
9
+ VFLAGS += --tool=memcheck
10
+ VFLAGS += --leak-check=full
11
+ VFLAGS += --error-exitcode=1
12
+
7
13
  test: tests.out
8
14
  @./tests.out
9
15
 
16
+ memcheck: tests.out
17
+ @valgrind $(VFLAGS) ./tests.out
18
+ @echo "Memory check passed"
19
+
10
20
  clean:
11
21
  rm -f *.o *.out
12
22
 
@@ -1,13 +1,22 @@
1
1
  CFLAGS = -std=c99
2
+ CFLAGS += -g
2
3
  CFLAGS += -Wall
3
4
  CFLAGS += -Wextra
4
5
  CFLAGS += -pedantic
5
6
  CFLAGS += -Werror
6
7
 
8
+ VFLAGS = --quiet
9
+ VFLAGS += --tool=memcheck
10
+ VFLAGS += --leak-check=full
11
+ VFLAGS += --error-exitcode=1
7
12
 
8
13
  test: tests.out
9
14
  @./tests.out
10
15
 
16
+ memcheck: tests.out
17
+ @valgrind $(VFLAGS) ./tests.out
18
+ @echo "Memory check passed"
19
+
11
20
  clean:
12
21
  rm -f *.o *.out
13
22
 
@@ -1,13 +1,22 @@
1
1
  CFLAGS = -std=c99
2
+ CFLAGS += -g
2
3
  CFLAGS += -Wall
3
4
  CFLAGS += -Wextra
4
5
  CFLAGS += -pedantic
5
6
  CFLAGS += -Werror
6
7
 
8
+ VFLAGS = --quiet
9
+ VFLAGS += --tool=memcheck
10
+ VFLAGS += --leak-check=full
11
+ VFLAGS += --error-exitcode=1
7
12
 
8
13
  test: tests.out
9
14
  @./tests.out
10
15
 
16
+ memcheck: tests.out
17
+ @valgrind $(VFLAGS) ./tests.out
18
+ @echo "Memory check passed"
19
+
11
20
  clean:
12
21
  rm -f *.o *.out
13
22
 
@@ -1,13 +1,22 @@
1
1
  CFLAGS = -std=c99
2
+ CFLAGS += -g
2
3
  CFLAGS += -Wall
3
4
  CFLAGS += -Wextra
4
5
  CFLAGS += -pedantic
5
6
  CFLAGS += -Werror
6
7
 
8
+ VFLAGS = --quiet
9
+ VFLAGS += --tool=memcheck
10
+ VFLAGS += --leak-check=full
11
+ VFLAGS += --error-exitcode=1
7
12
 
8
13
  test: tests.out
9
14
  @./tests.out
10
15
 
16
+ memcheck: tests.out
17
+ @valgrind $(VFLAGS) ./tests.out
18
+ @echo "Memory check passed"
19
+
11
20
  clean:
12
21
  rm -f *.o *.out
13
22
 
@@ -1,12 +1,20 @@
1
1
  CFLAGS = -std=c99
2
+ CFLAGS += -g
2
3
  CFLAGS += -Wall
3
4
  CFLAGS += -Wextra
4
5
  CFLAGS += -pedantic
5
6
  CFLAGS += -Werror
6
7
 
8
+ VFLAGS = --quiet
9
+ VFLAGS += --tool=memcheck
10
+ VFLAGS += --leak-check=full
11
+ VFLAGS += --error-exitcode=1
7
12
 
8
13
  test: tests.out
9
14
  @./tests.out
15
+ memcheck: tests.out
16
+ @valgrind $(VFLAGS) ./tests.out
17
+ @echo "Memory check passed"
10
18
 
11
19
  clean:
12
20
  rm -f *.o *.out