on master help sign in
Switch to CircleCI and fix Tcl tests (#35)
commit90e624e914d64ee505d5cfa961d63d54d046d572 authorSidney Kochman <sidney@repl.it> dateWed 24 Jul 2019, 13:29 (7 years ago) parent388a85c
9 files changed+78−241
.circleci/config.yml+36 .travis.yml−8 Makefile+4 README.md+1 tests/tcl/1_plus_1.exp+2−19 tests/tcl/a_few_outputs.exp+15−88 tests/tcl/from_file.exp+6−33 tests/tcl/input_output.exp+10−73 tests/tcl/unknown_command.exp+4−20
.circleci/config.ymlnew file+36
@@ -0,0 +1,36 @@
1+version: 2.1
2+jobs:
3+ build_and_test:
4+ docker:
5+ - image: docker:18.09
6+ steps:
7+ - checkout
8+ - setup_remote_docker
9+ - run: apk add --no-cache --no-progress make
10+ - run: make test-image
11+ build_test_and_deploy:
12+ docker:
13+ - image: docker:18.09
14+ steps:
15+ - checkout
16+ - setup_remote_docker
17+ - run: apk add --no-cache --no-progress make
18+ - run: make test-image
19+ - deploy:
20+ command: |
21+ echo "$DOCKER_PASSWORD" | docker login --username "$DOCKER_USERNAME" --password-stdin
22+ docker tag prybar:latest replco/prybar:latest
23+ docker push replco/prybar:latest
24+workflows:
25+ ci:
26+ jobs:
27+ - build_and_test:
28+ filters:
29+ branches:
30+ ignore: master
31+ - build_test_and_deploy:
32+ context: Docker Hub
33+ filters:
34+ branches:
35+ only:
36+ - master
.travis.ymldeleted−8
@@ -1,8 +0,0 @@
1−sudo: required
2−
3−services:
4− - docker
5−
6−script:
7− - docker build -t prybar .
8− - docker run -t prybar make test
Makefile+4
@@ -24,6 +24,10 @@ image: ## Build a Docker image with Prybar for distribution
2424test: ## Run integration tests
2525 ./run_tests
2626
27+.PHONY: test-image
28+test-image: image ## Test Docker image for distribution
29+ docker run -t --rm prybar ./run_tests
30+
2731.PHONY: clean
2832clean: ## Remove build artifacts
2933 rm -f prybar-* languages/*/generated_*.go prybar_assets/sqlite/patch.so
README.md+1
@@ -58,6 +58,7 @@ written in the host language which starts a Prybar-compatible REPL.
5858 make docker Run a shell with Prybar inside Docker
5959 make image Build a Docker image with Prybar for distribution
6060 make test Run integration tests
61+ make test-image Test Docker image for distribution
6162 make clean Remove build artifacts
6263 make help Show this message
6364
tests/tcl/1_plus_1.exp+2−19
@@ -4,25 +4,8 @@ set timeout -1
44spawn ./prybar-tcl -q -i
55match_max 100000
66expect -exact "\[J\[2K\r--> "
7−send -- "e"
8−expect -exact "\[J\[2K\r--> e"
9−send -- "x"
10−expect -exact "\[J\[2K\r--> ex"
11−send -- "p"
12−expect -exact "\[J\[2K\r--> exp"
13−send -- "r"
14−expect -exact "\[J\[2K\r--> expr"
15−send -- " "
16−expect -exact "\[J\[2K\r--> expr "
17−send -- "1"
18−expect -exact "\[J\[2K\r--> expr 1"
19−send -- "+"
20−expect -exact "\[J\[2K\r--> expr 1+"
21−send -- "1"
22−expect -exact "\[J\[2K\r--> expr 1+1"
23−send -- "\r"
24−expect -exact "\[J\[2K\r--> expr 1+1\[J\[2K\r--> expr 1+1\r
25−2\r
7+send -- "expr 1+1\r"
8+expect -exact "2\r
269\[J\[2K\r--> "
2710send -- ""
2811expect eof
tests/tcl/a_few_outputs.exp+15−88
@@ -3,91 +3,18 @@
33set timeout -1
44spawn ./prybar-tcl -q -i
55match_max 100000
6−expect -exact "\[J\[2K\r--> "
7−send -- "p"
8−expect -exact "\[J\[2K\r--> p"
9−send -- "u"
10−expect -exact "\[J\[2K\r--> pu"
11−send -- "t"
12−expect -exact "\[J\[2K\r--> put"
13−send -- "s"
14−expect -exact "\[J\[2K\r--> puts"
15−send -- " "
16−expect -exact "\[J\[2K\r--> puts "
17−send -- "\""
18−expect -exact "\[J\[2K\r--> puts \""
19−send -- "h"
20−expect -exact "\[J\[2K\r--> puts \"h"
21−send -- "e"
22−expect -exact "\[J\[2K\r--> puts \"he"
23−send -- "y"
24−expect -exact "\[J\[2K\r--> puts \"hey"
25−send -- "\""
26−expect -exact "\[J\[2K\r--> puts \"hey\""
27−send -- "\r"
28−expect -exact "\[J\[2K\r--> puts \"hey\"\[J\[2K\r--> puts \"hey\"\r
29−hey\r\r
30−\r
31−\[J\[2K\r--> "
32−send -- "p"
33−expect -exact "\[J\[2K\r--> p"
34−send -- "u"
35−expect -exact "\[J\[2K\r--> pu"
36−send -- "t"
37−expect -exact "\[J\[2K\r--> put"
38−send -- "s"
39−expect -exact "\[J\[2K\r--> puts"
40−send -- " "
41−expect -exact "\[J\[2K\r--> puts "
42−send -- "\""
43−expect -exact "\[J\[2K\r--> puts \""
44−send -- "h"
45−expect -exact "\[J\[2K\r--> puts \"h"
46−send -- "e"
47−expect -exact "\[J\[2K\r--> puts \"he"
48−send -- "y"
49−expect -exact "\[J\[2K\r--> puts \"hey"
50−send -- "\""
51−expect -exact "\[J\[2K\r--> puts \"hey\""
52−send -- "\r"
53−expect -exact "\[J\[2K\r--> puts \"hey\"\[J\[2K\r--> puts \"hey\"\r
54−hey\r\r
55−\r
56−\[J\[2K\r--> "
57−send -- "p"
58−expect -exact "\[J\[2K\r--> p"
59−send -- "u"
60−expect -exact "\[J\[2K\r--> pu"
61−send -- "t"
62−expect -exact "\[J\[2K\r--> put"
63−send -- "s"
64−expect -exact "\[J\[2K\r--> puts"
65−send -- " "
66−expect -exact "\[J\[2K\r--> puts "
67−send -- "\""
68−expect -exact "\[J\[2K\r--> puts \""
69−send -- "h"
70−expect -exact "\[J\[2K\r--> puts \"h"
71−send -- "e"
72−expect -exact "\[J\[2K\r--> puts \"he"
73−send -- "e"
74−expect -exact "\[J\[2K\r--> puts \"hee"
75−send -- "e"
76−expect -exact "\[J\[2K\r--> puts \"heee"
77−send -- "e"
78−expect -exact "\[J\[2K\r--> puts \"heeee"
79−send -- "e"
80−expect -exact "\[J\[2K\r--> puts \"heeeee"
81−send -- "e"
82−expect -exact "\[J\[2K\r--> puts \"heeeeee"
83−send -- "y"
84−expect -exact "\[J\[2K\r--> puts \"heeeeeey"
85−send -- "\""
86−expect -exact "\[J\[2K\r--> puts \"heeeeeey\""
87−send -- "\r"
88−expect -exact "\[J\[2K\r--> puts \"heeeeeey\"\[J\[2K\r--> puts \"heeeeeey\"\r
89−heeeeeey\r\r
90−\r
91−\[J\[2K\r--> "
92−send -- ""
93−expect eof
6+
7+send "puts \"hey\"\r"
8+expect -exact "puts \"hey\"\r"
9+expect -exact "hey\r"
10+expect -exact "--> "
11+
12+send "puts \"hey\"\r"
13+expect -exact "puts \"hey\"\r"
14+expect -exact "hey\r"
15+expect -exact "--> "
16+
17+send "puts \"hello\"\r"
18+expect -exact "puts \"hello\"\r"
19+expect -exact "hello\r"
20+expect -exact "--> "
tests/tcl/from_file.exp+6−33
@@ -3,36 +3,9 @@
33set timeout -1
44spawn ./prybar-tcl -q -i ./test_files/hello_tcl.tcl
55match_max 100000
6−expect -exact "Hello, Tcl!\r\r
7−\[J\[2K\r--> "
8−send -- "p"
9−expect -exact "\[J\[2K\r--> p"
10−send -- "u"
11−expect -exact "\[J\[2K\r--> pu"
12−send -- "t"
13−expect -exact "\[J\[2K\r--> put"
14−send -- "s"
15−expect -exact "\[J\[2K\r--> puts"
16−send -- " "
17−expect -exact "\[J\[2K\r--> puts "
18−send -- "\$"
19−expect -exact "\[J\[2K\r--> puts \$"
20−send -- "m"
21−expect -exact "\[J\[2K\r--> puts \$m"
22−send -- "y"
23−expect -exact "\[J\[2K\r--> puts \$my"
24−send -- "_"
25−expect -exact "\[J\[2K\r--> puts \$my_"
26−send -- "n"
27−expect -exact "\[J\[2K\r--> puts \$my_n"
28−send -- "u"
29−expect -exact "\[J\[2K\r--> puts \$my_nu"
30−send -- "m"
31−expect -exact "\[J\[2K\r--> puts \$my_num"
32−send -- "\r"
33−expect -exact "\[J\[2K\r--> puts \$my_num\[J\[2K\r--> puts \$my_num\r
34−1000\r\r
35−\r
36−\[J\[2K\r--> "
37−send -- ""
38−expect eof
6+
7+expect -exact "Hello, Tcl!\r"
8+
9+send "puts \$my_num\r"
10+expect -exact "--> puts \$my_num\r"
11+expect -exact "1000\r"
tests/tcl/input_output.exp+10−73
@@ -3,76 +3,13 @@
33set timeout -1
44spawn ./prybar-tcl -q -i
55match_max 100000
6−expect -exact "\[J\[2K\r--> "
7−send -- "s"
8−expect -exact "\[J\[2K\r--> s"
9−send -- "e"
10−expect -exact "\[J\[2K\r--> se"
11−send -- "t"
12−expect -exact "\[J\[2K\r--> set"
13−send -- " "
14−expect -exact "\[J\[2K\r--> set "
15−send -- "i"
16−expect -exact "\[J\[2K\r--> set i"
17−send -- "n"
18−expect -exact "\[J\[2K\r--> set in"
19−send -- "p"
20−expect -exact "\[J\[2K\r--> set inp"
21−send -- " "
22−expect -exact "\[J\[2K\r--> set inp "
23−send -- "\["
24−expect -exact "\[J\[2K\r--> set inp \["
25−send -- "g"
26−expect -exact "\[J\[2K\r--> set inp \[g"
27−send -- "e"
28−expect -exact "\[J\[2K\r--> set inp \[ge"
29−send -- "t"
30−expect -exact "\[J\[2K\r--> set inp \[get"
31−send -- "s"
32−expect -exact "\[J\[2K\r--> set inp \[gets"
33−send -- " "
34−expect -exact "\[J\[2K\r--> set inp \[gets "
35−send -- "s"
36−expect -exact "\[J\[2K\r--> set inp \[gets s"
37−send -- "t"
38−expect -exact "\[J\[2K\r--> set inp \[gets st"
39−send -- "d"
40−expect -exact "\[J\[2K\r--> set inp \[gets std"
41−send -- "i"
42−expect -exact "\[J\[2K\r--> set inp \[gets stdi"
43−send -- "n"
44−expect -exact "\[J\[2K\r--> set inp \[gets stdin"
45−send -- "\]"
46−expect -exact "\[J\[2K\r--> set inp \[gets stdin\]"
47−send -- "\r"
48−expect -exact "\[J\[2K\r--> set inp \[gets stdin\]\[J\[2K\r--> set inp \[gets stdin\]\r
49−"
50−send -- "helloooooo\r"
51−expect -exact "helloooooo\r
52−helloooooo\r
53−\[J\[2K\r--> "
54−send -- "p"
55−expect -exact "\[J\[2K\r--> p"
56−send -- "u"
57−expect -exact "\[J\[2K\r--> pu"
58−send -- "t"
59−expect -exact "\[J\[2K\r--> put"
60−send -- "s"
61−expect -exact "\[J\[2K\r--> puts"
62−send -- " "
63−expect -exact "\[J\[2K\r--> puts "
64−send -- "\$"
65−expect -exact "\[J\[2K\r--> puts \$"
66−send -- "i"
67−expect -exact "\[J\[2K\r--> puts \$i"
68−send -- "n"
69−expect -exact "\[J\[2K\r--> puts \$in"
70−send -- "p"
71−expect -exact "\[J\[2K\r--> puts \$inp"
72−send -- "\r"
73−expect -exact "\[J\[2K\r--> puts \$inp\[J\[2K\r--> puts \$inp\r
74−helloooooo\r\r
75−\r
76−\[J\[2K\r--> "
77−send -- ""
78−expect eof
6+expect -exact "--> "
7+send "set inp \[gets stdin\]\r"
8+expect -exact "--> set inp \[gets stdin\]\r"
9+send "hey\r"
10+expect -exact "hey\r"
11+expect -exact "--> "
12+send "puts \$inp\r"
13+expect -exact "--> puts \$inp\r"
14+expect -exact "hey\r"
15+expect -exact "--> "
tests/tcl/unknown_command.exp+4−20
@@ -3,23 +3,7 @@
33set timeout -1
44spawn ./prybar-tcl -q -i
55match_max 100000
6−expect -exact "\[J\[2K\r--> "
7−send -- "h"
8−expect -exact "\[J\[2K\r--> h"
9−send -- "m"
10−expect -exact "\[J\[2K\r--> hm"
11−send -- "m"
12−expect -exact "\[J\[2K\r--> hmm"
13−send -- "m"
14−expect -exact "\[J\[2K\r--> hmmm"
15−send -- "m"
16−expect -exact "\[J\[2K\r--> hmmmm"
17−send -- "m"
18−expect -exact "\[J\[2K\r--> hmmmmm"
19−send -- "\r"
20−expect -exact "\[J\[2K\r--> hmmmmm\[J\[2K\r--> hmmmmm\r
21−error: invalid command name \"hmmmmm\"\r
22−\r
23−\[J\[2K\r--> "
24−send -- ""
25−expect eof
6+send "hmm\r"
7+expect -exact "hmm\r"
8+expect -exact "error: invalid command name \"hmm\"\r"
9+expect -exact "--> "