Skip to content

Commit 0680cd2

Browse files
authored
Merge pull request #5 from bratpiorka/rrudnick_simple_test
Add basic test
2 parents afa0453 + bf8ee84 commit 0680cd2

2 files changed

Lines changed: 39 additions & 11 deletions

File tree

.github/workflows/basic.yml

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ permissions:
2222
contents: read
2323

2424
jobs:
25-
build:
25+
build-and-test:
2626
runs-on: ubuntu-latest
2727

2828
steps:
29-
- uses: actions/checkout@v4
29+
- uses: actions/checkout@v5
3030

3131
- name: Check if oneAPI is already installed
3232
id: check-oneapi
@@ -57,9 +57,16 @@ jobs:
5757
5858
- name: Build
5959
run: cargo build --verbose
60-
61-
- name: Run tests
62-
run: cargo test --verbose
60+
61+
- name: Run workspace tests
62+
run: cargo test --workspace --verbose
63+
64+
- name: Run examples
65+
run: |
66+
for example_path in oneapi-rs/examples/*.rs; do
67+
example="$(basename "$example_path" .rs)"
68+
cargo run -p oneapi-rs --example "$example" --verbose
69+
done
6370
6471
- name: Generate documentation
6572
run: |
@@ -79,14 +86,14 @@ jobs:
7986
HTML
8087
8188
- name: Upload documentation artifact
82-
uses: actions/upload-artifact@v4
89+
uses: actions/upload-artifact@v6
8390
with:
8491
name: documentation
8592
path: target/doc
8693

8794
deploy-documentation:
8895
if: (github.event_name == 'push' && github.ref == 'refs/heads/main') || (github.event_name == 'workflow_dispatch' && inputs.deploy_documentation == 'true')
89-
needs: build
96+
needs: build-and-test
9097
runs-on: ubuntu-latest
9198

9299
permissions:
@@ -100,19 +107,19 @@ jobs:
100107

101108
steps:
102109
- name: Download documentation artifact
103-
uses: actions/download-artifact@v4
110+
uses: actions/download-artifact@v7
104111
with:
105112
name: documentation
106113
path: target/doc
107114

108115
- name: Configure GitHub Pages
109-
uses: actions/configure-pages@v5
116+
uses: actions/configure-pages@v6
110117

111118
- name: Upload documentation to GitHub Pages
112-
uses: actions/upload-pages-artifact@v3
119+
uses: actions/upload-pages-artifact@v5
113120
with:
114121
path: target/doc
115122

116123
- name: Deploy documentation to GitHub Pages
117124
id: deployment
118-
uses: actions/deploy-pages@v4
125+
uses: actions/deploy-pages@v5

oneapi-rs/tests/alloc.rs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
//
2+
// Copyright (C) 2026 Intel Corporation
3+
//
4+
// Under the MIT License or the Apache License v2.0.
5+
// See LICENSE-MIT and LICENSE-APACHE for license information.
6+
// SPDX-License-Identifier: MIT OR Apache-2.0
7+
//
8+
9+
use oneapi_rs::queue::Queue;
10+
11+
#[test]
12+
fn shared_allocation_host_values() {
13+
let queue = Queue::new();
14+
let mut buffer = unsafe { queue.alloc_uninit_shared::<u32>(10) };
15+
16+
for (index, value) in buffer.iter_mut().enumerate() {
17+
*value = index as u32;
18+
}
19+
20+
assert_eq!(buffer.as_ref(), &[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]);
21+
}

0 commit comments

Comments
 (0)