-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
trying to auto generate a page that will report what functions need t…
…o be implemented or not...
- Loading branch information
Showing
16 changed files
with
239 additions
and
15 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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,10 @@ | ||
# Transition Tracking | ||
|
||
## TODO sort these and then try to get out of the google doc (maybe need a hash map that pre-maps the one's we're skipping so the count is accurate) | ||
```slosh | ||
(get-globals-sorted) | ||
``` | ||
|
||
```slosh | ||
(legacy_forms) | ||
``` |
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,3 @@ | ||
The slosh_test crate contains some special functions that use additional dependencies | ||
used to build slosh documentation and run the slosh tests. These actions can | ||
be performed manually but are also done by CI. |
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,105 @@ | ||
use std::env::consts::{ARCH, OS}; | ||
use std::process::Command; | ||
|
||
use chrono::prelude::Utc; | ||
|
||
#[cfg(debug_assertions)] | ||
const BUILD_TYPE: &str = "debug"; | ||
#[cfg(not(debug_assertions))] | ||
const BUILD_TYPE: &str = "release"; | ||
|
||
fn main() { | ||
let version_string = if have_git() { | ||
format!( | ||
"{} {} ({}:{}{}, {} build, {} [{}], {} UTC [{}])", | ||
env!("CARGO_PKG_NAME"), | ||
env!("CARGO_PKG_VERSION"), | ||
get_branch_name(), | ||
get_commit_hash(), | ||
if is_working_tree_clean() { "" } else { "+" }, | ||
BUILD_TYPE, | ||
OS, | ||
ARCH, | ||
Utc::now().format("%b %d %Y, %T"), | ||
get_rustc_version(), | ||
) | ||
} else { | ||
format!( | ||
"{} {} ({} build, {} [{}], {} UTC [{}])", | ||
env!("CARGO_PKG_NAME"), | ||
env!("CARGO_PKG_VERSION"), | ||
BUILD_TYPE, | ||
OS, | ||
ARCH, | ||
Utc::now().format("%b %d %Y, %T"), | ||
get_rustc_version(), | ||
) | ||
}; | ||
|
||
println!("cargo:rustc-env=VERSION_STRING={}", version_string); | ||
} | ||
|
||
fn have_git() -> bool { | ||
Command::new("git") | ||
.arg("--version") | ||
.current_dir(env!("CARGO_MANIFEST_DIR")) | ||
.output() | ||
.is_ok() | ||
} | ||
|
||
fn get_commit_hash() -> String { | ||
let output = Command::new("git") | ||
.arg("log") | ||
.arg("-1") | ||
.arg("--pretty=format:%h") // Abbreviated commit hash | ||
// .arg("--pretty=format:%H") // Full commit hash | ||
.current_dir(env!("CARGO_MANIFEST_DIR")) | ||
.output() | ||
.unwrap(); | ||
|
||
assert!(output.status.success()); | ||
|
||
String::from_utf8_lossy(&output.stdout).to_string() | ||
} | ||
|
||
fn get_branch_name() -> String { | ||
let output = Command::new("git") | ||
.arg("rev-parse") | ||
.arg("--abbrev-ref") | ||
.arg("HEAD") | ||
.current_dir(env!("CARGO_MANIFEST_DIR")) | ||
.output() | ||
.unwrap(); | ||
|
||
assert!(output.status.success()); | ||
|
||
String::from_utf8_lossy(&output.stdout) | ||
.trim_end() | ||
.to_string() | ||
} | ||
|
||
fn is_working_tree_clean() -> bool { | ||
let status = Command::new("git") | ||
.arg("diff") | ||
.arg("--quiet") | ||
.arg("--exit-code") | ||
.current_dir(env!("CARGO_MANIFEST_DIR")) | ||
.status() | ||
.unwrap(); | ||
|
||
status.code().unwrap() == 0 | ||
} | ||
|
||
fn get_rustc_version() -> String { | ||
let output = Command::new("rustc") | ||
.arg("--version") | ||
.current_dir(env!("CARGO_MANIFEST_DIR")) | ||
.output() | ||
.unwrap(); | ||
|
||
assert!(output.status.success()); | ||
|
||
String::from_utf8_lossy(&output.stdout) | ||
.trim_end() | ||
.to_string() | ||
} |
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,28 @@ | ||
#!/usr/bin/env slosh_test | ||
|
||
(let (globals (get-globals-sorted) | ||
globals-len (len globals) | ||
i 0 | ||
failing-tests {}) | ||
(while (< i globals-len) | ||
(prn "Symbol: " globals.~i) | ||
(prn "===") | ||
(let (doc (doc-map globals.~i)) | ||
;; for some reason printing usage for vec-slice causes rust to panic with 'Handle 2045 is not a string!' | ||
(prn "Usage: " (str doc.:usage)) | ||
(prn "Description: " (str doc.:description)) | ||
(prn "Section: " (str doc.:section)) | ||
(if (not (err? (get failing-tests (->key globals.~i)))) | ||
(prn "~~~~~~~~~~~~~~~~~~~~~ Skipping failing test") | ||
(let (example (str doc.:example) | ||
read-in (read-all example)) | ||
(prn "Example: " example) | ||
(dotimes-i j (len read-in) | ||
(let (line (prn (str read-in.~j)) | ||
evaled (eval read-in.~j)) | ||
(if (err? evaled) | ||
(do (prn "Err: " (str evaled)) | ||
(err (mk-err :test (str "Err: " evaled)))) | ||
(prn "Result: " (str evaled))))))) | ||
(prn "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") | ||
(inc! i)))) |
File renamed without changes.
File renamed without changes.
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 @@ | ||
pub mod docs; |
Oops, something went wrong.