Skip to content

Commit b55d323

Browse files
committed
Add basic test
1 parent afa0453 commit b55d323

2 files changed

Lines changed: 32 additions & 11 deletions

File tree

.github/workflows/basic.yml

Lines changed: 11 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,9 @@ 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
6363

6464
- name: Generate documentation
6565
run: |
@@ -79,14 +79,14 @@ jobs:
7979
HTML
8080
8181
- name: Upload documentation artifact
82-
uses: actions/upload-artifact@v4
82+
uses: actions/upload-artifact@v6
8383
with:
8484
name: documentation
8585
path: target/doc
8686

8787
deploy-documentation:
8888
if: (github.event_name == 'push' && github.ref == 'refs/heads/main') || (github.event_name == 'workflow_dispatch' && inputs.deploy_documentation == 'true')
89-
needs: build
89+
needs: build-and-test
9090
runs-on: ubuntu-latest
9191

9292
permissions:
@@ -100,19 +100,19 @@ jobs:
100100

101101
steps:
102102
- name: Download documentation artifact
103-
uses: actions/download-artifact@v4
103+
uses: actions/download-artifact@v7
104104
with:
105105
name: documentation
106106
path: target/doc
107107

108108
- name: Configure GitHub Pages
109-
uses: actions/configure-pages@v5
109+
uses: actions/configure-pages@v6
110110

111111
- name: Upload documentation to GitHub Pages
112-
uses: actions/upload-pages-artifact@v3
112+
uses: actions/upload-pages-artifact@v5
113113
with:
114114
path: target/doc
115115

116116
- name: Deploy documentation to GitHub Pages
117117
id: deployment
118-
uses: actions/deploy-pages@v4
118+
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)