-
-
Notifications
You must be signed in to change notification settings - Fork 61
Expand file tree
/
Copy pathrunall.zig
More file actions
90 lines (75 loc) · 2.87 KB
/
runall.zig
File metadata and controls
90 lines (75 loc) · 2.87 KB
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
const std = @import("std");
pub fn main() !void {
var gpa = std.heap.GeneralPurposeAllocator(.{}){};
defer _ = gpa.deinit();
const allocator = gpa.allocator();
// Math algorithms
try runTest(allocator, "math/ceil");
try runTest(allocator, "math/crt");
try runTest(allocator, "math/primes");
try runTest(allocator, "math/fibonacci");
try runTest(allocator, "math/factorial");
try runTest(allocator, "math/euclidianGCDivisor");
try runTest(allocator, "math/gcd");
// Data Structures
try runTest(allocator, "ds/trie");
try runTest(allocator, "ds/linkedlist");
try runTest(allocator, "ds/doublylinkedlist");
try runTest(allocator, "ds/lrucache");
try runTest(allocator, "ds/stack");
try runTest(allocator, "ds/heap");
try runTest(allocator, "ds/queue");
// Dynamic Programming
try runTest(allocator, "dp/coinChange");
try runTest(allocator, "dp/knapsack");
try runTest(allocator, "dp/longestIncreasingSubsequence");
try runTest(allocator, "dp/editDistance");
// Sort
try runTest(allocator, "sort/quicksort");
try runTest(allocator, "sort/bubblesort");
try runTest(allocator, "sort/radixsort");
try runTest(allocator, "sort/mergesort");
try runTest(allocator, "sort/insertsort");
try runTest(allocator, "sort/selectionSort");
try runTest(allocator, "sort/heapSort");
// Search
try runTest(allocator, "search/bSearchTree");
try runTest(allocator, "search/rb");
try runTest(allocator, "search/linearSearch");
// Threads
try runTest(allocator, "threads/threadpool");
// Web
try runTest(allocator, "web/httpClient");
try runTest(allocator, "web/httpServer");
try runTest(allocator, "web/tls1_3");
// Machine Learning
try runTest(allocator, "machine_learning/k_means_clustering");
// Numerical Methods
try runTest(allocator, "numerical_methods/newton_raphson");
// Tiger Style
try runTest(allocator, "tiger_style/time_simulation");
try runTest(allocator, "tiger_style/merge_sort_tiger");
try runTest(allocator, "tiger_style/knapsack_tiger");
try runTest(allocator, "tiger_style/ring_buffer");
try runTest(allocator, "tiger_style/raft_consensus");
try runTest(allocator, "tiger_style/two_phase_commit");
try runTest(allocator, "tiger_style/vsr_consensus");
try runTest(allocator, "tiger_style/robin_hood_hash");
try runTest(allocator, "tiger_style/skip_list");
}
fn runTest(allocator: std.mem.Allocator, comptime algorithm: []const u8) !void {
var child = std.process.Child.init(&[_][]const u8{
"zig",
"build",
"test",
"-Dalgorithm=" ++ algorithm,
} ++ args, allocator);
child.stderr = std.fs.File.stderr();
child.stdout = std.fs.File.stdout();
_ = try child.spawnAndWait();
}
const args = [_][]const u8{
"--summary",
"all",
"-freference-trace",
};