Skip to content

Commit

Permalink
ci: Test docs in addition to cargo t --all-targets (#392)
Browse files Browse the repository at this point in the history
* ci: Test docs in addition to `cargo t --all-targets`

Unfortunately docs are not explicitly (build-)tested as part of
`--all-targets` allowing broken code to slip in as shown by #390.

Also remove the `rust` listing type which is the default, leaving only
`no_run` (until the CI has a loadable Vulkan library).

* ash: Fix errors and warnings in (now tested) documentation comments
  • Loading branch information
MarijnS95 authored Mar 14, 2021
1 parent dba9e6b commit 8444db4
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,16 @@ jobs:
profile: minimal
toolchain: stable
override: true
- uses: actions-rs/cargo@v1
- name: Test all targets
uses: actions-rs/cargo@v1
with:
command: test
args: --workspace --all-targets
- name: Test docs
uses: actions-rs/cargo@v1
with:
command: test
args: --workspace --doc

fmt:
name: Rustfmt
Expand Down
6 changes: 3 additions & 3 deletions ash/src/entry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,10 @@ impl<L> EntryCustom<L> {
}

#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkEnumerateInstanceVersion.html>"]
/// ```rust,no_run
/// ```no_run
/// # use ash::{Entry, vk};
/// # fn main() -> Result<(), Box<std::error::Error>> {
/// let entry = Entry::new()?;
/// # fn main() -> Result<(), Box<dyn std::error::Error>> {
/// let entry = unsafe { Entry::new() }?;
/// match entry.try_enumerate_instance_version()? {
/// // Vulkan 1.1+
/// Some(version) => {
Expand Down
6 changes: 3 additions & 3 deletions ash/src/entry_libloading.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ impl EntryCustom<Arc<Library>> {
/// `dlopen`ing native libraries is inherently unsafe. The safety guidelines
/// for [`Library::new`] and [`Library::get`] apply here.
///
/// ```rust,no_run
/// ```no_run
/// use ash::{vk, Entry, version::EntryV1_0};
/// # fn main() -> Result<(), Box<std::error::Error>> {
/// let entry = Entry::new()?;
/// # fn main() -> Result<(), Box<dyn std::error::Error>> {
/// let entry = unsafe { Entry::new() }?;
/// let app_info = vk::ApplicationInfo {
/// api_version: vk::make_version(1, 0, 0),
/// ..Default::default()
Expand Down
4 changes: 2 additions & 2 deletions ash/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
//!
//! ## Examples
//!
//! ```rust,no_run
//! ```no_run
//! use ash::{vk, Entry, version::EntryV1_0};
//! # fn main() -> Result<(), Box<dyn std::error::Error>> {
//! let entry = Entry::new()?;
//! let entry = unsafe { Entry::new() }?;
//! let app_info = vk::ApplicationInfo {
//! api_version: vk::make_version(1, 0, 0),
//! ..Default::default()
Expand Down

0 comments on commit 8444db4

Please sign in to comment.