Browse Source

Initial commit

Alois Mahdal 6 years ago
commit
97a651cc75

+ 4
- 0
Makefile View File

@@ -0,0 +1,4 @@
1
+# See LICENSE.md file for copyright and license details.
2
+
3
+MKIT_DIR=/usr/share/jattool/tdk/utils/mkit
4
+include $(MKIT_DIR)/mkit.mk

+ 15
- 0
mkit.ini View File

@@ -0,0 +1,15 @@
1
+[INCLUDE:/usr/share/jattool/tdk/skel/mkit.ini]
2
+
3
+[project]
4
+    pkgname    = jats-demo
5
+    version    = 0.0.0
6
+    maintainer = Joe Maintainer <joe@example.org>
7
+
8
+[macros]
9
+    __JATS_SUITENAME__ = demo
10
+    __JATS_REQUIRES__  = shellfu-bash-xcase
11
+
12
+[files]
13
+    jats = src demo
14
+
15
+#mkit version=0.0.32

+ 1
- 0
src/.jats/domain View File

@@ -0,0 +1 @@
1
+my.example.org

+ 1
- 0
src/.jats/format View File

@@ -0,0 +1 @@
1
+0.0

+ 1
- 0
src/.jats/ns View File

@@ -0,0 +1 @@
1
+foodept

+ 1
- 0
src/.jats/sut_pname View File

@@ -0,0 +1 @@
1
+barpkg

+ 1
- 0
src/bar/baz-advanced/main.fmf View File

@@ -0,0 +1 @@
1
+description: Advanced example

+ 8
- 0
src/bar/baz-advanced/test View File

@@ -0,0 +1,8 @@
1
+#!/bin/bash
2
+
3
+jat__pstartt "jattool sessid"
4
+    jat__cmd -h "sessid subcommand returns zero" \
5
+        jat sessid
6
+    jat__cmd -h "sessid subcommand prints something" \
7
+        test -n "$(jattool sessid)"
8
+jat__pend

+ 1
- 0
src/bar/baz-simple/main.fmf View File

@@ -0,0 +1 @@
1
+description: Simple example

+ 17
- 0
src/bar/baz-simple/test View File

@@ -0,0 +1,17 @@
1
+#!/bin/bash
2
+
3
+jat__pstarts "collect output"
4
+    jat__cmd -h "run ls" \
5
+        eval "ls >ls.out 2>ls.err"
6
+jat__pend
7
+
8
+jat__pstarts "verify output"
9
+    jat__cmd -h "stdout is present" \
10
+        test -s "ls.out"
11
+    jat__cmd -h "stderr is empty" -S 1 \
12
+        test -s "ls.err"
13
+jat__pend
14
+
15
+jat__pstartc "clean up"
16
+    jat__cmd rm "ls.out" "ls.err"
17
+jat__pend

+ 1
- 0
src/foo/main.fmf View File

@@ -0,0 +1 @@
1
+description: Foo-ish example

+ 10
- 0
src/foo/test View File

@@ -0,0 +1,10 @@
1
+#!/bin/bash
2
+
3
+jat__pstartt "example test phase"
4
+    jat__cmd -h "true is still true" \
5
+        true
6
+    jat__cmp -h "five is still greater than three" \
7
+        5 gt 3
8
+    jat__cmp -h "foo still ends with oo" \
9
+        foo re '.*oo'
10
+jat__pend

+ 5
- 0
src/main.fmf View File

@@ -0,0 +1,5 @@
1
+jats:
2
+    domain: my.example.org
3
+    ns: xns
4
+    sut_pname: coreutils
5
+    format: 0.0

+ 40
- 0
src/webackup/test View File

@@ -0,0 +1,40 @@
1
+#!/bin/bash
2
+
3
+show() {
4
+    jat__log_info ".. file:        $(<file)"
5
+    jat__log_info ".. dir/subfile: $(<dir/subfile)"
6
+}
7
+
8
+jat__pstarts make
9
+    jat__eval "mkdir dir"
10
+    jat__eval "echo foo >file"
11
+    jat__eval "echo foo >dir/subfile"
12
+jat__pend
13
+
14
+jat__pstartt
15
+
16
+    jat__filebackup file
17
+    jat__filebackup dir
18
+
19
+    echo bar >file
20
+    echo bar >dir/subfile
21
+    show
22
+
23
+    jat__filebackup -n deeper dir
24
+
25
+    echo baz >file
26
+    echo baz >dir/subfile
27
+    show
28
+
29
+    jat__filerestore -n deeper
30
+    jat__eval "grep -qxF baz file"
31
+    jat__eval "grep -qxF bar dir/subfile"
32
+    show
33
+
34
+    jat__filerestore
35
+
36
+    jat__eval "grep -qxF foo file"
37
+    jat__eval "grep -qxF foo dir/subfile"
38
+    show
39
+
40
+jat__pend

+ 1
- 0
src/xcosi/main.fmf View File

@@ -0,0 +1 @@
1
+description: xcase example

+ 21
- 0
src/xcosi/test View File

@@ -0,0 +1,21 @@
1
+#!/bin/bash
2
+
3
+shellfu import xcase
4
+
5
+
6
+xcase__enum() {
7
+    xcase__permute Foo f0 f1 f2 \
8
+      | xcase__per Bar b0 b1 b2
9
+}
10
+
11
+xcase__setup() {
12
+    jat__cmd echo "$Foo" > Foo
13
+    jat__cmd echo "$Bar" > Bar
14
+}
15
+
16
+xcase__test() {
17
+    jat__cmd test -s Foo
18
+    jat__cmd test -s Bar
19
+}
20
+
21
+xcase__run -v