forked from waterloop/wcosa
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.sh
executable file
·46 lines (42 loc) · 1.17 KB
/
test.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/usr/bin/env bash
set -xe # Be verbose and exit immediately if any command fails
# install wcosa
python setup.py -q install
# Test Case 1
rm -rf test-wcosa
mkdir test-wcosa
cd test-wcosa
wcosa create --board mega2560
wcosa build
wcosa clean
wcosa update --board nano
wcosa build
cd ..
# Test Case 2
rm -rf test-wcosa
mkdir test-wcosa
cd test-wcosa
wcosa create --ide clion --board mega2560
git init
rm src/main.cpp
rm config.json
mkdir src/module
cp ../test/main.cpp src/main.cpp
cp ../test/config.json config.json
cp ../test/module/* src/module/
wcosa package install waterloop/wlib
wcosa update
wcosa build
# Test Case 3
rm -rf test-wcosa
mkdir test-wcosa
cd test-wcosa
wcosa package install waterloop/wlib
test -d .pkg/wlib && test -d lib/wlib # Exists and linked at lib/wlib
wcosa package install waterloop/wlib at wlib-alt
test -d wlib-alt # Now also linked at wlib-alt
test $(readlink wlib-alt) = $(readlink lib/wlib) # Point to same location
wcosa package remove waterloop/wlib at wlib-alt
test -d .pkg/wlib && test ! -d wlib-alt # Still exists, but not at wlib-alt
wcosa package remove waterloop/wlib
test ! -d .pkg/wlib && test ! -L lib/wlib # Does not exist and no dangling link