diff --git a/Makefile b/Makefile index 82b3c67..26cd99c 100644 --- a/Makefile +++ b/Makefile @@ -33,7 +33,6 @@ VALGRIND := $(filter-out valgrind/RaceExampleTest,$(VALGRIND)) # VALGRIND_ALL has currently unavailable tests filtered out VALGRIND_ALL := $(VALGRIND) -VALGRIND_ALL := $(filter-out valgrind/FibTest,$(VALGRIND_ALL)) VALGRIND_ALL := $(filter-out valgrind/IntervalTreeTest,$(VALGRIND_ALL)) VALGRIND_ALL := $(filter-out valgrind/MatVecTest,$(VALGRIND_ALL)) VALGRIND_ALL := $(filter-out valgrind/PSquareMatrixMultiplyTest,$(VALGRIND_ALL)) @@ -57,7 +56,7 @@ $(TESTS): test/%: bin/% $(VALGRIND): valgrind/%: bin/% # https://stackoverflow.com/a/55130152 - valgrind $(VALGRINDFLAGS) ./$^ > /dev/null + valgrind $(VALGRINDFLAGS) ./$^ valgrind > /dev/null echo valgrind ./$^ Completed clean: diff --git a/src/FibTest.cpp b/src/FibTest.cpp index 7b48ebc..29d668d 100644 --- a/src/FibTest.cpp +++ b/src/FibTest.cpp @@ -36,8 +36,12 @@ int test(size_t n, size_t expected) { } int main(int argc, char *argv[]) { + int N = 21; + if (argc >= 2) + // Valgrind: reduce test size + N = 13; size_t prev = 0, cur = 1; - for (int n = 0; n < 21; n++) { + for (int n = 0; n < N; n++) { test(n, prev); prev += cur; cur ^= prev ^= cur ^= prev; diff --git a/src/GraphTest.cpp b/src/GraphTest.cpp index 5d40214..c711ff4 100644 --- a/src/GraphTest.cpp +++ b/src/GraphTest.cpp @@ -63,8 +63,8 @@ void graph_weighted_test(const size_t v, const size_t e) { } int main(int argc, char *argv[]) { - const size_t v = get_argv(argc, argv, 1, 5); - const size_t e = get_argv(argc, argv, 2, 10); + const size_t v = 5; + const size_t e = 10; std::cout << "GraphAdjList" << std::endl; graph_test>(v, e); std::cout << "GraphAdjMatrix" << std::endl; diff --git a/src/RaceExampleTest.cpp b/src/RaceExampleTest.cpp index a8e6bbd..58d61ca 100644 --- a/src/RaceExampleTest.cpp +++ b/src/RaceExampleTest.cpp @@ -34,6 +34,9 @@ int test(size_t n) { } int main(int argc, char *argv[]) { + if (argc >= 2) + // Valgrind: do not test at all + return 0; for (int n = 0; n < 2147483647; n++) if (test(n)) return 0;