Get tests passing and skip some prybars on darwin
commit037c3887c4bec6cc41c32e3e908b01bde4cc2f25
authorConnor Brewster <cbrewster@hey.com>
dateTue 6 Jul 2021, 11:08 (5 years ago)
parent694ece1
build-prybar.nix+4
@@ -45,6 +45,10 @@ buildGoModule {
4545 checkPhase = ''
4646 runHook preCheck
4747
48+ # Nix unsets HOME but some tests rely on it, let's set it to whatever tmp dir the check
49+ # is running in.
50+ export HOME=$(echo pwd)
51+
4852 "${bash}/bin/bash" "./run_tests_language" "${language}" "${expect}/bin"
4953
5054 runHook postCheck
default.nix+14−6
@@ -1,6 +1,14 @@
1−# flake-compat makes Nix flakes compatible with the old Nix cli commands, like nix-build and nix-shell.
2−(import (fetchTarball {
3− url =
4− "https://github.com/edolstra/flake-compat/archive/99f1c2157fba4bfe6211a321fd0ee43199025dbf.tar.gz";
5− sha256 = "0x2jn3vrawwv9xp15674wjz9pixwjyj3j771izayl962zziivbx2";
6−}) { src = ./.; }).defaultNix
1+{ system ? builtins.currentSystem }:
2+
3+let
4+
5+ # flake-compat makes Nix flakes compatible with the old Nix cli commands, like nix-build and nix-shell.
6+ default = (import (fetchTarball {
7+ url =
8+ "https://github.com/edolstra/flake-compat/archive/99f1c2157fba4bfe6211a321fd0ee43199025dbf.tar.gz";
9+ sha256 = "0x2jn3vrawwv9xp15674wjz9pixwjyj3j771izayl962zziivbx2";
10+ }) { src = ./.; }).defaultNix;
11+
12+in
13+
14+builtins.getAttr system default.packages
flake.lock+4−3
@@ -17,15 +17,16 @@
1717 },
1818 "nixpkgs": {
1919 "locked": {
20− "lastModified": 1625586387,
21− "narHash": "sha256-E6bgeBk8FXGXYUsYtSMVfKBlwUBBFklkWX/7xxgJTnU=",
20+ "lastModified": 1625512941,
21+ "narHash": "sha256-P2POZzfG+Hp8ktIWwkOs/OMB8jSsQvIPQaLO0swpgZo=",
2222 "owner": "nixos",
2323 "repo": "nixpkgs",
24− "rev": "b30e41473deeb5f73fc28e2421da509d818d050b",
24+ "rev": "3e0ce8c5d478d06b37a4faa7a4cc8642c6bb97de",
2525 "type": "github"
2626 },
2727 "original": {
2828 "owner": "nixos",
29+ "ref": "nixpkgs-unstable",
2930 "repo": "nixpkgs",
3031 "type": "github"
3132 }
flake.nix+21−17
@@ -2,7 +2,7 @@
22 description = "A universal interpreter front-end";
33
44 inputs = {
5− nixpkgs.url = "github:nixos/nixpkgs";
5+ nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
66 flake-utils.url = "github:numtide/flake-utils";
77 };
88
@@ -33,26 +33,11 @@
3333 setFlags = true;
3434 };
3535
36− prybar-julia = buildPrybar {
37− language = "julia";
38− buildInputs = [ julia ];
39− setFlags = true;
40− binaries = [ pkgs.zlib ];
41− };
42−
4336 prybar-nodejs = buildPrybar {
4437 language = "nodejs";
4538 binaries = [ pkgs.nodejs ];
4639 };
4740
48− # The official Ruby packages is running ruby 2.7
49− prybar-ruby = buildPrybar {
50− language = "ruby";
51− buildInputs = [ pkgs.ruby ];
52− pkgName = "ruby-2.7";
53− setFlags = true;
54− };
55−
5641 prybar-python2 = buildPrybar {
5742 language = "python2";
5843 buildInputs = [ pkgs.python2 ];
@@ -100,7 +85,26 @@
10085 language = "tcl";
10186 buildInputs = [ pkgs.tcl ];
10287 };
103− };
88+ }
89+ # These packages have issues on macOS
90+ // nixpkgs.lib.optionalAttrs (!pkgs.stdenv.isDarwin) {
91+ prybar-julia = buildPrybar {
92+ language = "julia";
93+ buildInputs = [ julia ];
94+ setFlags = true;
95+ binaries = [ pkgs.zlib ];
96+ };
97+
98+ # The official Ruby packages is running ruby 2.7
99+ prybar-ruby = buildPrybar {
100+ language = "ruby";
101+ buildInputs = [ pkgs.ruby ];
102+ pkgName = "ruby-2.7";
103+ setFlags = true;
104+ };
105+
106+ };
107+
104108 });
105109}
106110
tests/clojure/all.exp+1−1
@@ -1,4 +1,4 @@
1−#!/usr/bin/expect -f
1+#!/usr/bin/env expect -f
22
33# ignore ANSI escape sequences
44set _ "(?:.*?)"
tests/clojure/evaluate_expression.exp+1−1
@@ -1,4 +1,4 @@
1−#!/usr/bin/expect -f
1+#!/usr/bin/env expect -f
22
33# ignore ANSI escape sequences
44set _ "(?:.*?)"
tests/clojure/initialize_code_with_script.exp+1−1
@@ -1,4 +1,4 @@
1−#!/usr/bin/expect -f
1+#!/usr/bin/env expect -f
22
33# ignore ANSI escape sequences
44set _ "(?:.*?)"
tests/clojure/initialize_expression_with_script.exp+1−1
@@ -1,4 +1,4 @@
1−#!/usr/bin/expect -f
1+#!/usr/bin/env expect -f
22
33# ignore ANSI escape sequences
44set _ "(?:.*?)"
tests/clojure/initialize_repl_with_script.exp+1−1
@@ -1,4 +1,4 @@
1−#!/usr/bin/expect -f
1+#!/usr/bin/env expect -f
22
33# ignore ANSI escape sequences
44set _ "(?:.*?)"
tests/clojure/plus_1_1.exp+1−1
@@ -1,4 +1,4 @@
1−#!/usr/bin/expect -f
1+#!/usr/bin/env expect -f
22
33# ignore ANSI escape sequences
44set _ "(?:.*?)"
tests/clojure/print.exp+1−1
@@ -1,4 +1,4 @@
1−#!/usr/bin/expect -f
1+#!/usr/bin/env expect -f
22
33# ignore ANSI escape sequences
44set _ "(?:.*?)"
tests/clojure/quiet_repl.exp+1−1
@@ -1,4 +1,4 @@
1−#!/usr/bin/expect -f
1+#!/usr/bin/env expect -f
22
33# ignore ANSI escape sequences
44set _ "(?:.*?)"
tests/clojure/run_code.exp+1−1
@@ -1,4 +1,4 @@
1−#!/usr/bin/expect -f
1+#!/usr/bin/env expect -f
22
33set timeout -1
44spawn ./prybar-clojure -q -c {(do (println "foo") "bar")}
tests/clojure/run_script.exp+1−1
@@ -1,4 +1,4 @@
1−#!/usr/bin/expect -f
1+#!/usr/bin/env expect -f
22
33spawn ./prybar-clojure ./test_files/hello.clj
44expect eof
tests/julia/1_plus_1.exp+1−1
@@ -1,4 +1,4 @@
1−#!/usr/bin/expect -f
1+#!/usr/bin/env expect -f
22
33set timeout -1
44spawn ./prybar-julia -q -i
tests/julia/header.exp+1−1
@@ -1,4 +1,4 @@
1−#!/usr/bin/expect -f
1+#!/usr/bin/env expect -f
22#
33# This Expect script was generated by autoexpect on Fri Jun 12 21:00:42 2020
44# Expect and autoexpect were both written by Don Libes, NIST.
tests/julia/input.exp+1−1
@@ -1,4 +1,4 @@
1−#!/usr/bin/expect -f
1+#!/usr/bin/env expect -f
22
33set timeout -1
44spawn ./prybar-julia -q -i
tests/julia/print_a_line.exp+1−1
@@ -1,4 +1,4 @@
1−#!/usr/bin/expect -f
1+#!/usr/bin/env expect -f
22
33set timeout -1
44spawn ./prybar-julia -q -i
tests/julia/start_with_file.exp+1−1
@@ -1,4 +1,4 @@
1−#!/usr/bin/expect -f
1+#!/usr/bin/env expect -f
22
33set timeout -1
44spawn ./prybar-julia -q -i ./test_files/hi_julia.jl
tests/lua/always_try_expression.exp+1−1
@@ -1,4 +1,4 @@
1−#!/usr/bin/expect -f
1+#!/usr/bin/env expect -f
22
33set timeout -1
44spawn ./prybar-lua -q -i
tests/lua/history.exp+1−1
@@ -1,4 +1,4 @@
1−#!/usr/bin/expect -f
1+#!/usr/bin/env expect -f
22
33set timeout -1
44spawn ./prybar-lua -q -i
tests/lua/load_file.exp+1−1
@@ -1,4 +1,4 @@
1−#!/usr/bin/expect -f
1+#!/usr/bin/env expect -f
22
33set timeout -1
44spawn ./prybar-lua -i ./test_files/hello.lua
tests/lua/ps1_ps2.exp+1−1
@@ -1,4 +1,4 @@
1−#!/usr/bin/expect -f
1+#!/usr/bin/env expect -f
22
33set timeout -1
44spawn ./prybar-lua -i -ps1 ps1 -ps2 ps2
tests/lua/quiet.exp+1−1
@@ -1,4 +1,4 @@
1−#!/usr/bin/expect -f
1+#!/usr/bin/env expect -f
22
33set timeout -1
44spawn ./prybar-lua -q -i
tests/lua/returns.exp+1−1
@@ -1,4 +1,4 @@
1−#!/usr/bin/expect -f
1+#!/usr/bin/env expect -f
22
33set timeout -1
44spawn ./prybar-lua -q -i
tests/nodejs/1_plus_1.exp+1−1
@@ -1,4 +1,4 @@
1−#!/usr/bin/expect -f
1+#!/usr/bin/env expect -f
22
33set timeout -1
44spawn ./prybar-nodejs -i -q
tests/nodejs/err.exp+1−1
@@ -1,4 +1,4 @@
1−#!/usr/bin/expect -f
1+#!/usr/bin/env expect -f
22
33set timeout -1
44spawn ./prybar-nodejs -i -q
tests/nodejs/eval_code.exp+1−1
@@ -1,4 +1,4 @@
1−#!/usr/bin/expect -f
1+#!/usr/bin/env expect -f
22
33set timeout -1
44spawn ./prybar-nodejs -q -e 1+1
tests/nodejs/global_bug.exp+2−2
@@ -1,9 +1,9 @@
1−#!/usr/bin/expect -f
1+#!/usr/bin/env expect -f
22
33set timeout -1
44spawn ./prybar-nodejs -i ./test_files/global_bug.js
55match_max 100000
6−expect -re {Node v\d+\.\d+.\d+ on linux}
6+expect -re {Node v\d+\.\d+.\d+ on (linux|darwin)}
77expect -exact "\[0m\[90mHint: hit control+c anytime to enter REPL.\[0m\r
88\[1G\[0J--> \[5G"
99send -- ""
tests/nodejs/header.exp+2−2
@@ -1,9 +1,9 @@
1−#!/usr/bin/expect -f
1+#!/usr/bin/env expect -f
22
33set timeout -1
44spawn ./prybar-nodejs -i
55match_max 100000
6−expect -re {Node v\d+\.\d+.\d+ on linux}
6+expect -re {Node v\d+\.\d+.\d+ on (linux|darwin)}
77expect -exact "\[1G\[0J--> \[5G"
88send -- ""
99expect eof
tests/nodejs/module_patching.exp+2−2
@@ -1,9 +1,9 @@
1−#!/usr/bin/expect -f
1+#!/usr/bin/env expect -f
22
33set timeout -1
44spawn ./prybar-nodejs -i ./test_files/global_bug.js
55match_max 100000
6−expect -re {Node v\d+\.\d+.\d+ on linux}
6+expect -re {Node v\d+\.\d+.\d+ on (linux|darwin)}
77expect -exact "\[0m\[90mHint: hit control+c anytime to enter REPL.\[0m\r
88\[1G\[0J--> \[5G"
99send -- ""
tests/nodejs/printing.exp+1−1
@@ -1,4 +1,4 @@
1−#!/usr/bin/expect -f
1+#!/usr/bin/env expect -f
22
33set timeout -1
44spawn ./prybar-nodejs -i -q
tests/nodejs/run_code.exp+1−1
@@ -1,4 +1,4 @@
1−#!/usr/bin/expect -f
1+#!/usr/bin/env expect -f
22
33set timeout -1
44spawn ./prybar-nodejs -q -c 1+1
tests/nodejs/run_file.exp+2−2
@@ -1,9 +1,9 @@
1−#!/usr/bin/expect -f
1+#!/usr/bin/env expect -f
22
33set timeout -1
44spawn ./prybar-nodejs -i ./test_files/hello.js
55match_max 100000
6−expect -re {Node v\d+\.\d+.\d+ on linux}
6+expect -re {Node v\d+\.\d+.\d+ on (linux|darwin)}
77expect -exact "\[0m\[90mHint: hit control+c anytime to enter REPL.\[0m\r
88hello\r
99\[32m'hello'\[39m\r
tests/nodejs/set_ps1.exp+1−1
@@ -1,4 +1,4 @@
1−#!/usr/bin/expect -f
1+#!/usr/bin/env expect -f
22
33set timeout -1
44spawn ./prybar-nodejs -i -q -ps1 custom
tests/ocaml/code_print.exp+1−1
@@ -1,4 +1,4 @@
1−#!/usr/bin/expect -f
1+#!/usr/bin/env expect -f
22
33spawn ./prybar-ocaml -q -c "print_endline(\"hello world\")"
44match_max 100000
tests/ocaml/exception.exp+1−1
@@ -1,4 +1,4 @@
1−#!/usr/bin/expect -f
1+#!/usr/bin/env expect -f
22
33spawn ./prybar-ocaml -q -i
44match_max 100000
tests/ocaml/expr.exp+1−1
@@ -1,4 +1,4 @@
1−#!/usr/bin/expect -f
1+#!/usr/bin/env expect -f
22
33spawn ./prybar-ocaml -q -e 1+1
44match_max 100000
tests/ocaml/not_quiet.exp+1−1
@@ -1,4 +1,4 @@
1−#!/usr/bin/expect -f
1+#!/usr/bin/env expect -f
22
33spawn ./prybar-ocaml -e 1+1
44match_max 100000
tests/ocaml/ps1.exp+1−1
@@ -1,4 +1,4 @@
1−#!/usr/bin/expect -f
1+#!/usr/bin/env expect -f
22
33spawn ./prybar-ocaml -q -i -ps1 ">>"
44match_max 100000
tests/ocaml/ps2.exp+1−1
@@ -1,4 +1,4 @@
1−#!/usr/bin/expect -f
1+#!/usr/bin/env expect -f
22
33spawn ./prybar-ocaml -q -i -ps2 continuation
44match_max 100000
tests/ocaml/quiet.exp+1−1
@@ -1,4 +1,4 @@
1−#!/usr/bin/expect -f
1+#!/usr/bin/env expect -f
22
33spawn ./prybar-ocaml -q -i
44match_max 100000
tests/python2/1_plus_1.exp+1−1
@@ -1,4 +1,4 @@
1−#!/usr/bin/expect -f
1+#!/usr/bin/env expect -f
22
33spawn ./prybar-python2 -i
44match_max 100000
tests/python2/code_print.exp+1−1
@@ -1,4 +1,4 @@
1−#!/usr/bin/expect -f
1+#!/usr/bin/env expect -f
22
33spawn ./prybar-python2 -q -c print('hello')
44match_max 100000
tests/python2/exception.exp+1−1
@@ -1,4 +1,4 @@
1−#!/usr/bin/expect -f
1+#!/usr/bin/env expect -f
22
33spawn ./prybar-python2 -q -i
44match_max 100000
tests/python2/expr.exp+1−1
@@ -1,4 +1,4 @@
1−#!/usr/bin/expect -f
1+#!/usr/bin/env expect -f
22
33spawn ./prybar-python2 -e 1+1
44match_max 100000
tests/python2/ps1.exp+1−1
@@ -1,4 +1,4 @@
1−#!/usr/bin/expect -f
1+#!/usr/bin/env expect -f
22
33spawn ./prybar-python2 -i -ps1 somethingelse
44match_max 100000
tests/python2/ps2.exp+1−1
@@ -1,4 +1,4 @@
1−#!/usr/bin/expect -f
1+#!/usr/bin/env expect -f
22
33spawn ./prybar-python2 -i -ps2 continuation
44match_max 100000
tests/python2/quiet.exp+1−1
@@ -1,4 +1,4 @@
1−#!/usr/bin/expect -f
1+#!/usr/bin/env expect -f
22
33spawn ./prybar-python2 -q -i
44match_max 100000
tests/python2/stdout_stderr.exp+1−1
@@ -1,4 +1,4 @@
1−#!/usr/bin/expect -f
1+#!/usr/bin/env expect -f
22
33spawn ./prybar-python2 -q -i
44match_max 100000
tests/python3/1_plus_1.exp+1−1
@@ -1,4 +1,4 @@
1−#!/usr/bin/expect -f
1+#!/usr/bin/env expect -f
22
33set timeout -1
44spawn ./prybar-python3 -i -q
tests/python3/eval_code.exp+1−1
@@ -1,4 +1,4 @@
1−#!/usr/bin/expect -f
1+#!/usr/bin/env expect -f
22
33set timeout -1
44spawn ./prybar-python3 -e 1+1
tests/python3/printing.exp+1−1
@@ -1,4 +1,4 @@
1−#!/usr/bin/expect -f
1+#!/usr/bin/env expect -f
22
33set timeout -1
44spawn ./prybar-python3 -i -q
tests/python3/run_code.exp+1−1
@@ -1,4 +1,4 @@
1−#!/usr/bin/expect -f
1+#!/usr/bin/env expect -f
22
33set timeout -1
44spawn ./prybar-python3 -c print('hello')
tests/python3/set_ps1.exp+1−1
@@ -1,4 +1,4 @@
1−#!/usr/bin/expect -f
1+#!/usr/bin/env expect -f
22
33set timeout -1
44spawn ./prybar-python3 -i -q -ps1 custom
tests/python3/set_ps2.exp+1−1
@@ -1,4 +1,4 @@
1−#!/usr/bin/expect -f
1+#!/usr/bin/env expect -f
22
33set timeout -1
44spawn ./prybar-python3 -i -q -ps2 custom
tests/python3/show_header.exp+1−1
@@ -1,4 +1,4 @@
1−#!/usr/bin/expect -f
1+#!/usr/bin/env expect -f
22
33set timeout -1
44spawn ./prybar-python3 -i
tests/python3/stderr_red.exp+1−1
@@ -1,4 +1,4 @@
1−#!/usr/bin/expect -f
1+#!/usr/bin/env expect -f
22
33# red is currently nondeterministic
44exit 0
tests/sqlite/1_plus_1.exp+1−1
@@ -1,4 +1,4 @@
1−#!/usr/bin/expect -f
1+#!/usr/bin/env expect -f
22
33spawn ./prybar-sqlite -q -i
44expect -- "^--> "
tests/sqlite/eval.exp+1−1
@@ -1,4 +1,4 @@
1−#!/usr/bin/expect -f
1+#!/usr/bin/env expect -f
22
33spawn ./prybar-sqlite -e "select 1+1;"
44expect ^2
tests/sqlite/exec.exp+1−1
@@ -1,4 +1,4 @@
1−#!/usr/bin/expect -f
1+#!/usr/bin/env expect -f
22
33spawn ./prybar-sqlite -c "select 1+1;"
44expect ^eof
tests/sqlite/header.exp+1−1
@@ -1,4 +1,4 @@
1−#!/usr/bin/expect -f
1+#!/usr/bin/env expect -f
22
33spawn ./prybar-sqlite -i
44expect -gl "-- Loading resources from /tmp/sqlite-config*\r\nSQLite version 3.27.2*\r\nEnter \".help\" for usage hints.\r\n--> "
tests/sqlite/quiet.exp+1−1
@@ -1,4 +1,4 @@
1−#!/usr/bin/expect -f
1+#!/usr/bin/env expect -f
22
33spawn ./prybar-sqlite -q -i
44expect "^--> "
tests/sqlite/read_file.exp+1−1
@@ -1,4 +1,4 @@
1−#!/usr/bin/expect -f
1+#!/usr/bin/env expect -f
22
33spawn ./prybar-sqlite -q -i ./test_files/hello.sql
44expect -- "^hey there\r
tests/tcl/a_few_outputs.exp+1−1
@@ -1,4 +1,4 @@
1−#!/usr/bin/expect -f
1+#!/usr/bin/env expect -f
22
33set timeout -1
44spawn ./prybar-tcl -q -i
tests/tcl/from_file.exp+1−1
@@ -1,4 +1,4 @@
1−#!/usr/bin/expect -f
1+#!/usr/bin/env expect -f
22
33set timeout -1
44spawn ./prybar-tcl -q -i ./test_files/hello_tcl.tcl
tests/tcl/input_output.exp+1−1
@@ -1,4 +1,4 @@
1−#!/usr/bin/expect -f
1+#!/usr/bin/env expect -f
22
33set timeout -1
44spawn ./prybar-tcl -q -i
tests/tcl/invalid_command.exp+1−1
@@ -1,4 +1,4 @@
1−#!/usr/bin/expect -f
1+#!/usr/bin/env expect -f
22
33set timeout -1
44spawn ./prybar-tcl -q -i ./test-files/hi_julia.jl
tests/tcl/unknown_command.exp+1−1
@@ -1,4 +1,4 @@
1−#!/usr/bin/expect -f
1+#!/usr/bin/env expect -f
22
33set timeout -1
44spawn ./prybar-tcl -q -i