add rust test and run tests from main
This commit is contained in:
parent
a6cf224826
commit
3dbcb8176c
8 changed files with 31 additions and 23 deletions
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
__pycache__
|
||||
*.lock
|
|
@ -1,10 +0,0 @@
|
|||
(ns testoperenv.main
|
||||
(:require [medley.core :as m]
|
||||
[babashka.process :as p]
|
||||
))
|
||||
|
||||
(defn -main []
|
||||
(println "Hello, World!")
|
||||
(:out (p/shell {:out :string :err :string} "bash" "-c" "echo -n foobar")))
|
||||
|
||||
|
|
@ -1 +0,0 @@
|
|||
pti@mars.124815:1695820260
|
|
@ -1,10 +1,9 @@
|
|||
(ns testoperenv.main
|
||||
(:require [medley.core :as m]
|
||||
[babashka.process :as p]
|
||||
))
|
||||
(:require [clojure.test :refer [run-tests]]
|
||||
[testoperenv.test-languages]))
|
||||
|
||||
(defn -main []
|
||||
(println "Hello, World!")
|
||||
(:out (p/shell {:out :string :err :string} "bash" "-c" "echo -n foobar")))
|
||||
(println "Testing the operating environment")
|
||||
(run-tests 'testoperenv.test-languages))
|
||||
|
||||
|
||||
|
|
14
bb/testoperenv/test_languages.clj
Normal file
14
bb/testoperenv/test_languages.clj
Normal file
|
@ -0,0 +1,14 @@
|
|||
(ns testoperenv.test-languages
|
||||
(:require [clojure.test :refer [deftest is testing]]
|
||||
[clojure.string :as str]
|
||||
[testoperenv.cmd :refer [run-cmd-in-dir]]))
|
||||
|
||||
|
||||
(deftest test-python
|
||||
(testing "python tooling is installed"
|
||||
(is (str/includes? (run-cmd-in-dir "python" "poetry" "run" "pytest" "smoketest.py") "[100%]"))))
|
||||
|
||||
(deftest test-rust
|
||||
(testing "rust tooling is installed"
|
||||
(is (str/includes? (run-cmd-in-dir "rust" "cargo" "run") "Rust is awesome"))))
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
(ns testoperenv.test-python
|
||||
(:require [clojure.test :refer [deftest is testing]]))
|
||||
|
||||
|
||||
(deftest test-python
|
||||
(testing "python is installed"
|
||||
(is (= "foobar" (run-cmd-in-dir "python" "poetry" "pytest" "smoketest.py"))))))
|
8
rust/Cargo.toml
Normal file
8
rust/Cargo.toml
Normal file
|
@ -0,0 +1,8 @@
|
|||
[package]
|
||||
name = "rust"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
3
rust/src/main.rs
Normal file
3
rust/src/main.rs
Normal file
|
@ -0,0 +1,3 @@
|
|||
fn main() {
|
||||
println!("Rust is awesome!");
|
||||
}
|
Loading…
Reference in a new issue