Skip to content

Commit

Permalink
add makefile, move tests
Browse files Browse the repository at this point in the history
  • Loading branch information
scottmckendry committed Nov 4, 2024
1 parent 8ac5e85 commit b4afea1
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 10 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- name: Report
run: odin report ./2021
- name: Test
run: odin test ./2021
run: cd 2021 && make test
- name: Check
run: odin check ./2021 -vet --strict-style

Expand All @@ -27,8 +27,7 @@ jobs:
with:
token: ${{ secrets.GITHUB_TOKEN }}

- run: cd 2021 && odin build .
- run: cd 2021 && ./2021 -benchmark
- run: cd 2021 && make bench
- run: cd 2022 && go build .
- run: cd 2022 && ./aoc2022 -benchmark
- run: cd 2023 && go build .
Expand Down
9 changes: 9 additions & 0 deletions 2021/makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
test:
cp ./tests/*.odin . # keeps tests in seperate directory
odin test . -vet -strict-style -out:test_build
rm *_test.odin
rm test_build

bench:
odin run . -out:2021 -- -benchmark
rm 2021
2 changes: 0 additions & 2 deletions 2021/01_test.odin → 2021/tests/01_test.odin
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
package main

import "core:fmt"
import "core:mem"
import "core:testing"


@(test)
d01p1 :: proc(t: ^testing.T) {
input: []string = {"199", "200", "208", "210", "200", "207", "240", "269", "260", "263"}
Expand Down
1 change: 0 additions & 1 deletion 2021/02_test.odin → 2021/tests/02_test.odin
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package main

import "core:fmt"
import "core:mem"
import "core:testing"

@(test)
Expand Down
1 change: 0 additions & 1 deletion 2021/03_test.odin → 2021/tests/03_test.odin
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package main

import "core:fmt"
import "core:mem"
import "core:testing"

@(test)
Expand Down
1 change: 0 additions & 1 deletion 2021/04_test.odin → 2021/tests/04_test.odin
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package main

import "core:fmt"
import "core:mem"
import "core:testing"

@(test)
Expand Down
2 changes: 0 additions & 2 deletions 2021/05_test.odin → 2021/tests/05_test.odin
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
package main

import "core:fmt"
import "core:mem"
import "core:testing"


@(test)
d05p1 :: proc(t: ^testing.T) {
input := []string {
Expand Down
File renamed without changes.

0 comments on commit b4afea1

Please sign in to comment.