-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_and_fmt.sh
executable file
·31 lines (31 loc) · 1.24 KB
/
run_and_fmt.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/bash
cd src/tests/math_tests/src
# Run cargo build
echo 'Compiling rust test driver...'
cargo build
echo 'Done...'
echo 'Execute rust test driver...'
# Run cargo run
cargo run
echo 'Done...fmtting cairo source'
scarb fmt
cd ../../../../
rm numbers.csv
echo 'Executing cairo test driver...'
cairo-test . -f laplace_pdf > numbers.csv
echo 'Done...'
# # Open the text file
echo 'Format numbers.csv...'
text_file="numbers.csv"
sed -i 's/)/,/g' "$text_file"
vi -c '%s/running 1 tests//g' -c 'wq' "$text_file"
vi -c '%s/test result: ok. 1 passed; 0 failed; 0 ignored; 49 filtered out;//g' -c 'wq' "$text_file"
tr -d '\n' < "$text_file" > tmpfile && mv tmpfile "$text_file"
tr -d '[:space:]' < "$text_file" > tmpfile && mv tmpfile "$text_file"
# sed -i 's/\[DEBUG\]true(raw:1953658213,\[DEBUG\](raw:/-/g' "$text_file"
# sed -i 's/\[DEBUG\]false(raw:439721161573,\[DEBUG\](raw://g' "$text_file"
# sed -i 's/,/,\n/g' "$text_file"
# vi -c '%s/testcubit::tests::math_tests::box_muller_tests::test_laplace_pdf...ok//g' -c 'wq' "$text_file"
# vi -c '%s/testcubit::tests::math_tests::laplace_pdf_tests::test_laplace_pdf...oktestresult:ok.1passed;0failed;0ignored;50filteredout;//g' -c 'wq' "$text_file"
# sed -i -e :a -e '/^\n*$/{$d;N;};/\n\n$/ba' "$text_file"
# echo 'Done...'