-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5bc73e4
commit 953e702
Showing
12 changed files
with
387 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,4 @@ Cargo.lock | |
/ignore/ | ||
/a.out | ||
/**/*.swp | ||
/build/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
# Testing | ||
|
||
This file outlines the regression testing plan for all platforms. | ||
|
||
## Redox | ||
|
||
<https://doc.redox-os.org/book/ch08-01-advanced-build.html#understanding-cross-compilation-for-redox> | ||
|
||
Tested on Fedora Silverblue 39 | ||
|
||
### Update Rust Nightly and Stable | ||
|
||
```shell | ||
rustup update nightly stable | ||
rustup target add --toolchain stable x86_64-unknown-redox | ||
``` | ||
|
||
### Install pre-requisites | ||
|
||
```shell | ||
sudo dnf install git file autoconf vim bison flex genisoimage gperf glibc-devel.i686 expat expat-devel fuse-devel fuse3-devel gmp-devel perl-HTML-Parser libpng-devel libtool libjpeg-turbo-devel libvorbis-devel SDL2_ttf-devel mesa-libOSMesa-devel m4 nasm po4a syslinux texinfo sdl12-compat-devel ninja-build meson python3-mako make gcc gcc-c++ openssl patch automake perl-Pod-Html perl-FindBin gperf curl gettext-devel perl-Pod-Xhtml pkgconf-pkg-config cmake cbindgen just qemu doxygen 'perl(ExtUtils::MakeMaker)' | ||
|
||
cargo install --locked --force --version 0.1.1 cargo-config | ||
``` | ||
|
||
### Get redox source | ||
|
||
```shell | ||
mkdir -p build/ | ||
cd build/ | ||
git clone https://gitlab.redox-os.org/redox-os/redox.git --origin upstream --recursive | ||
``` | ||
|
||
### Create our demo recipe | ||
|
||
Make sure whome is updated to the whoami testing branch. | ||
|
||
```shell | ||
mkdir -p build/redox/cookbook/recipes/demos/whome/ | ||
cp recipe.toml build/redox/cookbook/recipes/demos/whome/ | ||
cp build/redox/config/desktop.toml config/x86_64/ardaku.toml | ||
``` | ||
|
||
In `config/x86_64/ardaku.toml`, under `[packages]`: | ||
|
||
```toml | ||
whome = {} | ||
``` | ||
|
||
### Build Redox | ||
|
||
This takes a while | ||
|
||
```shell | ||
make all | ||
``` | ||
|
||
or | ||
|
||
```shell | ||
make rebuild | ||
``` | ||
|
||
### Run Redox | ||
|
||
```shell | ||
make qemu | ||
``` | ||
|
||
### Test it | ||
|
||
Verify you are on the new version | ||
|
||
```shell | ||
whome --version | ||
``` | ||
|
||
Default settings should output: | ||
|
||
```console | ||
realname: user | ||
username: user | ||
devicename: redox | ||
hostname: redox | ||
distro: Redox OS 0.8.0 | ||
desktop_env: Orbital | ||
platform: Redox | ||
arch: Unknown: x86_64 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Redox recipe for testing whoami | ||
|
||
[source] | ||
git = "https://github.com/AldaronLau/whome.git" | ||
|
||
[build] | ||
template = "cargo" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
//! This is mostly the same as fake.rs for now | ||
#[cfg(not(any(target_pointer_width = "32", target_pointer_width = "64")))] | ||
compile_error!("Unexpected pointer width for target platform"); | ||
|
||
use std::ffi::OsString; | ||
|
||
use crate::{ | ||
os::{Os, Target}, | ||
Arch, DesktopEnv, Language, Platform, Result, | ||
}; | ||
|
||
#[inline(always)] | ||
pub(crate) fn lang() -> impl Iterator<Item = String> { | ||
std::iter::once("en/US".to_string()) | ||
} | ||
|
||
impl Target for Os { | ||
fn langs(self) -> Vec<Language> { | ||
todo!() | ||
} | ||
|
||
#[inline(always)] | ||
fn realname(self) -> Result<OsString> { | ||
Ok("Anonymous".to_string().into()) | ||
} | ||
|
||
#[inline(always)] | ||
fn username(self) -> Result<OsString> { | ||
Ok("anonymous".to_string().into()) | ||
} | ||
|
||
#[inline(always)] | ||
fn devicename(self) -> Result<OsString> { | ||
Ok("Unknown".to_string().into()) | ||
} | ||
|
||
#[inline(always)] | ||
fn hostname(self) -> Result<String> { | ||
Ok("localhost".to_string()) | ||
} | ||
|
||
#[inline(always)] | ||
fn distro(self) -> Result<String> { | ||
Ok("Emulated".to_string()) | ||
} | ||
|
||
#[inline(always)] | ||
fn desktop_env(self) -> DesktopEnv { | ||
DesktopEnv::Unknown("Unknown Daku".to_string()) | ||
} | ||
|
||
#[inline(always)] | ||
fn platform(self) -> Platform { | ||
Platform::Unknown("Daku".to_string()) | ||
} | ||
|
||
#[inline(always)] | ||
fn arch(self) -> Result<Arch> { | ||
Ok(if cfg!(target_pointer_width = "64") { | ||
Arch::Wasm64 | ||
} else { | ||
Arch::Wasm32 | ||
}) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.