File tree Expand file tree Collapse file tree 1 file changed +23
-4
lines changed
Expand file tree Collapse file tree 1 file changed +23
-4
lines changed Original file line number Diff line number Diff line change 1+ incl gitko
2+
13func print_usage() -> NoReturn {
24 println_err("Usage: ./benchmark.jk <commit1> <commit2>");
35 println_err("This program compares the performance of the jinko interpreter between");
@@ -11,10 +13,7 @@ cli_args = args()
1113f_commit = cli_args.at(0)
1214s_commit = cli_args.at(1)
1315
14- // FIXME: Ugly
15- arg_equals_two = cli_args.amount() != 2;
16-
17- if arg_equals_two {
16+ if cli_args.amount() != 2 {
1817 println_err("benchmark.jk: invalid argument amount");
1918 print_usage();
2019}
@@ -23,3 +22,23 @@ if f_commit.equals(s_commit) {
2322 println_err("benchmark.jk: the two given commits should be different");
2423 print_usage();
2524}
25+
26+ jk_repo = Git(path: ".");
27+
28+ // FIXME: Add the following
29+ // original_commit = jk_repo.current_commit();
30+
31+ func checkout_and_test(hash: string) {
32+ if jk_repo.checkout(commit(hash)) {
33+ cmd("sh").with_arg("-c").with_arg("tests/func_tests.sh").execute();
34+ } else {
35+ // FIXME: Use string formatting here...
36+ println_err("benchmark.jk: invalid commit: ".concat(hash));
37+ print_usage();
38+ }
39+ }
40+
41+ checkout_and_test(f_commit);
42+ checkout_and_test(s_commit);
43+
44+ // FIXME: Switch back to the original commit
You can’t perform that action at this time.
0 commit comments