Skip to content

Commit

Permalink
[WORKFLOWS] adding test workflow using ytest + [FIX] fixing [BUG] Doc…
Browse files Browse the repository at this point in the history
…umentation workflow fails when there are warnings #13
  • Loading branch information
Cr0a3 committed Sep 9, 2024
1 parent bb8ef13 commit e44f917
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
env:
CARGO_INCREMENTAL: 0
CARGO_NET_RETRY: 10
RUSTFLAGS: "-D warnings -W unreachable-pub"
RUSTFLAGS: "-W unreachable-pub"
RUSTUP_MAX_RETRIES: 10

jobs:
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@ jobs:

steps:
- uses: actions/checkout@v4

- name: Install Rust toolchain
run: rustup update --no-self-update stable

- name: Build
run: cargo build --all

- name: Run tests
run: cargo test --all
30 changes: 30 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Run ir tests
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

env:
CARGO_TERM_COLOR: always

jobs:
ytest:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install Rust toolchain
run: |
rustup update --no-self-update stable
- name: Build
run: cargo build --all

- name: Run tests
run: |
for file in $(find tests -type f -name "*.yl"); do
echo "Processing $file"
cargo run -p ytest -- -t="$file"
done
18 changes: 18 additions & 0 deletions tests/IR/helloworld.yl
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# RUN:
cargo run -p ylc -- -in=%s -o=out.o
gcc out.o -o a.exe
./a.exe
# IN:
const const0 = "Hello World!\n\00"

define void @main() {
entry:
%0 = ptr const0
%1 = call void printf ptr %0
ret void 0

}
declare void @printf( ptr %0, ... )

# STDOUT:
Hello World!

0 comments on commit e44f917

Please sign in to comment.