Copy prybar assets into Nix derivation

Fix prybar Nix tests
This commit is contained in:
Connor Brewster 2021-10-12 12:05:43 -05:00
parent 922f628219
commit 52e368173a
74 changed files with 89 additions and 81 deletions

View File

@ -2,7 +2,7 @@
, pkgName ? language }:
{ lib, buildGoModule, fetchFromGitHub, bash, expect, pkg-config, runCommand, git
, python3, copyPathToStore, rev }:
, python3, copyPathToStore, rev, makeWrapper }:
buildGoModule {
pname = "prybar-${language}";
@ -11,7 +11,7 @@ buildGoModule {
src = ./.;
inherit buildInputs;
nativeBuildInputs = [ pkg-config ];
nativeBuildInputs = [ pkg-config makeWrapper ];
subPackages = [ "languages/${language}" ];
@ -49,6 +49,8 @@ buildGoModule {
# is running in.
export HOME=$(echo pwd)
patchShebangs run_no_pty ./tests/${language}/*.exp
"${bash}/bin/bash" "./run_tests_language" "${language}" "${expect}/bin"
runHook postCheck
@ -61,5 +63,14 @@ buildGoModule {
postInstall = ''
mv $out/bin/${language} $out/bin/prybar-${language}
if [ -d "./prybar_assets/${language}" ]
then
mkdir -p "$out/prybar_assets/${language}"
cp -R "./prybar_assets/${language}" "$out/prybar_assets/"
wrapProgram "$out/bin/prybar-${language}" \
--set PRYBAR_ASSETS_DIR "$out/prybar_assets"
fi
'';
}

View File

@ -3,13 +3,10 @@ const repl = require("repl");
const path = require("path");
const fs = require("fs");
const vm = require("vm");
const { isatty } = require('tty');
const rl = require(path.join(
process.cwd(),
"prybar_assets",
"nodejs",
"input-sync.js"
));
const { isatty } = require("tty");
const assets_dir =
process.env.PRYBAR_ASSETS_DIR || path.join(process.cwd(), "prybar_assets");
const rl = require(path.join(assets_dir, "nodejs", "input-sync.js"));
const Module = require("module");
let r;

View File

@ -1,4 +1,4 @@
#!/usr/bin/env bash
#!/bin/bash
stdin="/tmp/prybar_stdin"
stdout="/tmp/prybar_stdout"
stderr="/tmp/prybar_stderr"

View File

@ -1,4 +1,4 @@
#!/usr/bin/env -S expect -f
#!/usr/bin/expect -f
# ignore ANSI escape sequences
set _ "(?:.*?)"

View File

@ -1,4 +1,4 @@
#!/usr/bin/env -S expect -f
#!/usr/bin/expect -f
# ignore ANSI escape sequences
set _ "(?:.*?)"

View File

@ -1,4 +1,4 @@
#!/usr/bin/env -S expect -f
#!/usr/bin/expect -f
# ignore ANSI escape sequences
set _ "(?:.*?)"

View File

@ -1,4 +1,4 @@
#!/usr/bin/env -S expect -f
#!/usr/bin/expect -f
# ignore ANSI escape sequences
set _ "(?:.*?)"

View File

@ -1,4 +1,4 @@
#!/usr/bin/env -S expect -f
#!/usr/bin/expect -f
# ignore ANSI escape sequences
set _ "(?:.*?)"

View File

@ -1,4 +1,4 @@
#!/usr/bin/env -S expect -f
#!/usr/bin/expect -f
# ignore ANSI escape sequences
set _ "(?:.*?)"

View File

@ -1,4 +1,4 @@
#!/usr/bin/env -S expect -f
#!/usr/bin/expect -f
# ignore ANSI escape sequences
set _ "(?:.*?)"

View File

@ -1,4 +1,4 @@
#!/usr/bin/env -S expect -f
#!/usr/bin/expect -f
# ignore ANSI escape sequences
set _ "(?:.*?)"

View File

@ -1,4 +1,4 @@
#!/usr/bin/env -S expect -f
#!/usr/bin/expect -f
set timeout -1
spawn ./prybar-clojure -q -c {(do (println "foo") "bar")}

View File

@ -1,4 +1,4 @@
#!/usr/bin/env -S expect -f
#!/usr/bin/expect -f
spawn ./prybar-clojure ./test_files/hello.clj
expect eof

View File

@ -1,4 +1,4 @@
#!/usr/bin/env -S expect -f
#!/usr/bin/expect -f
set timeout -1
spawn ./prybar-julia -q -i

View File

@ -1,4 +1,4 @@
#!/usr/bin/env -S expect -f
#!/usr/bin/expect -f
#
# This Expect script was generated by autoexpect on Fri Jun 12 21:00:42 2020
# Expect and autoexpect were both written by Don Libes, NIST.

View File

@ -1,4 +1,4 @@
#!/usr/bin/env -S expect -f
#!/usr/bin/expect -f
set timeout -1
spawn ./prybar-julia -q -i

View File

@ -1,4 +1,4 @@
#!/usr/bin/env -S expect -f
#!/usr/bin/expect -f
set timeout -1
spawn ./prybar-julia -q -i

View File

@ -1,4 +1,4 @@
#!/usr/bin/env -S expect -f
#!/usr/bin/expect -f
set timeout -1
spawn ./prybar-julia -q -i ./test_files/hi_julia.jl

View File

@ -1,4 +1,4 @@
#!/usr/bin/env -S expect -f
#!/usr/bin/expect -f
set timeout -1
spawn ./prybar-lua -q -i

View File

@ -1,4 +1,4 @@
#!/usr/bin/env -S expect -f
#!/usr/bin/expect -f
set timeout -1
spawn ./prybar-lua -q -i

View File

@ -1,4 +1,4 @@
#!/usr/bin/env -S expect -f
#!/usr/bin/expect -f
set timeout -1
spawn ./prybar-lua -i ./test_files/hello.lua

View File

@ -1,4 +1,4 @@
#!/usr/bin/env -S expect -f
#!/usr/bin/expect -f
set timeout -1
spawn ./prybar-lua -i -ps1 ps1 -ps2 ps2

View File

@ -1,4 +1,4 @@
#!/usr/bin/env -S expect -f
#!/usr/bin/expect -f
set timeout -1
spawn ./prybar-lua -q -i

View File

@ -1,4 +1,4 @@
#!/usr/bin/env -S expect -f
#!/usr/bin/expect -f
set timeout -1
spawn ./prybar-lua -q -i

View File

@ -1,4 +1,4 @@
#!/usr/bin/env -S expect -f
#!/usr/bin/expect -f
set timeout -1
spawn ./prybar-nodejs -i -q

View File

@ -1,4 +1,4 @@
#!/usr/bin/env -S expect -f
#!/usr/bin/expect -f
set timeout -1
spawn ./prybar-nodejs -i -q

View File

@ -1,4 +1,4 @@
#!/usr/bin/env -S expect -f
#!/usr/bin/expect -f
set timeout -1
spawn ./prybar-nodejs -i -q

View File

@ -1,4 +1,4 @@
#!/usr/bin/env -S expect -f
#!/usr/bin/expect -f
set timeout -1
spawn ./prybar-nodejs -q -e 1+1

View File

@ -1,4 +1,4 @@
#!/usr/bin/env -S expect -f
#!/usr/bin/expect -f
set timeout -1
spawn ./prybar-nodejs -i ./test_files/global_bug.js

View File

@ -1,4 +1,4 @@
#!/usr/bin/env -S expect -f
#!/usr/bin/expect -f
set timeout -1
spawn ./prybar-nodejs -i

View File

@ -1,4 +1,4 @@
#!/usr/bin/env -S expect -f
#!/usr/bin/expect -f
set timeout -1
spawn ./prybar-nodejs -i ./test_files/global_bug.js

View File

@ -1,4 +1,4 @@
#!/usr/bin/env -S expect -f
#!/usr/bin/expect -f
set timeout -1
spawn ./prybar-nodejs -i -q

View File

@ -1,4 +1,4 @@
#!/usr/bin/env -S expect -f
#!/usr/bin/expect -f
set timeout -1
spawn ./prybar-nodejs -i -q

View File

@ -1,4 +1,4 @@
#!/usr/bin/env -S expect -f
#!/usr/bin/expect -f
set timeout -1
set stty_init raw
spawn ./run_no_pty ./prybar-nodejs -q -i

View File

@ -1,4 +1,4 @@
#!/usr/bin/env -S expect -f
#!/usr/bin/expect -f
set timeout -1
spawn ./prybar-nodejs -i -q

View File

@ -1,4 +1,4 @@
#!/usr/bin/env -S expect -f
#!/usr/bin/expect -f
set timeout -1
spawn ./prybar-nodejs -i -q

View File

@ -1,4 +1,4 @@
#!/usr/bin/env -S expect -f
#!/usr/bin/expect -f
set timeout -1
spawn ./prybar-nodejs -i -q

View File

@ -1,4 +1,4 @@
#!/usr/bin/env -S expect -f
#!/usr/bin/expect -f
set timeout -1
spawn ./prybar-nodejs -q -c 1+1

View File

@ -1,4 +1,4 @@
#!/usr/bin/env -S expect -f
#!/usr/bin/expect -f
set timeout -1
spawn ./prybar-nodejs -i ./test_files/hello.js

View File

@ -1,4 +1,4 @@
#!/usr/bin/env -S expect -f
#!/usr/bin/expect -f
set timeout -1
spawn ./prybar-nodejs -i -q -ps1 custom

View File

@ -1,4 +1,4 @@
#!/usr/bin/env -S expect -f
#!/usr/bin/expect -f
spawn ./prybar-ocaml -q -c "print_endline(\"hello world\")"
match_max 100000

View File

@ -1,4 +1,4 @@
#!/usr/bin/env -S expect -f
#!/usr/bin/expect -f
spawn ./prybar-ocaml -q -i
match_max 100000

View File

@ -1,4 +1,4 @@
#!/usr/bin/env -S expect -f
#!/usr/bin/expect -f
spawn ./prybar-ocaml -q -e 1+1
match_max 100000

View File

@ -1,4 +1,4 @@
#!/usr/bin/env -S expect -f
#!/usr/bin/expect -f
spawn ./prybar-ocaml -e 1+1
match_max 100000

View File

@ -1,4 +1,4 @@
#!/usr/bin/env -S expect -f
#!/usr/bin/expect -f
spawn ./prybar-ocaml -q -i -ps1 ">>"
match_max 100000

View File

@ -1,4 +1,4 @@
#!/usr/bin/env -S expect -f
#!/usr/bin/expect -f
spawn ./prybar-ocaml -q -i -ps2 continuation
match_max 100000

View File

@ -1,4 +1,4 @@
#!/usr/bin/env -S expect -f
#!/usr/bin/expect -f
spawn ./prybar-ocaml -q -i
match_max 100000

View File

@ -1,4 +1,4 @@
#!/usr/bin/env -S expect -f
#!/usr/bin/expect -f
spawn ./prybar-python2 -i
match_max 100000

View File

@ -1,4 +1,4 @@
#!/usr/bin/env -S expect -f
#!/usr/bin/expect -f
spawn ./prybar-python2 -q -c print('hello')
match_max 100000

View File

@ -1,4 +1,4 @@
#!/usr/bin/env -S expect -f
#!/usr/bin/expect -f
spawn ./prybar-python2 -q -i
match_max 100000

View File

@ -1,4 +1,4 @@
#!/usr/bin/env -S expect -f
#!/usr/bin/expect -f
spawn ./prybar-python2 -e 1+1
match_max 100000

View File

@ -1,4 +1,4 @@
#!/usr/bin/env -S expect -f
#!/usr/bin/expect -f
spawn ./prybar-python2 -i -ps1 somethingelse
match_max 100000

View File

@ -1,4 +1,4 @@
#!/usr/bin/env -S expect -f
#!/usr/bin/expect -f
spawn ./prybar-python2 -i -ps2 continuation
match_max 100000

View File

@ -1,4 +1,4 @@
#!/usr/bin/env -S expect -f
#!/usr/bin/expect -f
spawn ./prybar-python2 -q -i
match_max 100000

View File

@ -1,4 +1,4 @@
#!/usr/bin/env -S expect -f
#!/usr/bin/expect -f
spawn ./prybar-python2 -q -i
match_max 100000

View File

@ -1,4 +1,4 @@
#!/usr/bin/env -S expect -f
#!/usr/bin/expect -f
set timeout -1
spawn ./prybar-python3 -i -q

View File

@ -1,4 +1,4 @@
#!/usr/bin/env -S expect -f
#!/usr/bin/expect -f
set timeout -1
spawn ./prybar-python3 -e 1+1

View File

@ -1,4 +1,4 @@
#!/usr/bin/env -S expect -f
#!/usr/bin/expect -f
set timeout -1
spawn ./prybar-python3 -i -q

View File

@ -1,4 +1,4 @@
#!/usr/bin/env -S expect -f
#!/usr/bin/expect -f
set timeout -1
spawn ./prybar-python3 -c print('hello')

View File

@ -1,4 +1,4 @@
#!/usr/bin/env -S expect -f
#!/usr/bin/expect -f
set timeout -1
spawn ./prybar-python3 -i -q -ps1 custom

View File

@ -1,4 +1,4 @@
#!/usr/bin/env -S expect -f
#!/usr/bin/expect -f
set timeout -1
spawn ./prybar-python3 -i -q -ps2 custom

View File

@ -1,4 +1,4 @@
#!/usr/bin/env -S expect -f
#!/usr/bin/expect -f
set timeout -1
spawn ./prybar-python3 -i

View File

@ -1,4 +1,4 @@
#!/usr/bin/env -S expect -f
#!/usr/bin/expect -f
# red is currently nondeterministic
exit 0

View File

@ -1,4 +1,4 @@
#!/usr/bin/env -S expect -f
#!/usr/bin/expect -f
spawn ./prybar-sqlite -q -i
expect -- "^--> "

View File

@ -1,4 +1,4 @@
#!/usr/bin/env -S expect -f
#!/usr/bin/expect -f
spawn ./prybar-sqlite -e "select 1+1;"
expect ^2

View File

@ -1,4 +1,4 @@
#!/usr/bin/env -S expect -f
#!/usr/bin/expect -f
spawn ./prybar-sqlite -c "select 1+1;"
expect ^eof

View File

@ -1,4 +1,4 @@
#!/usr/bin/env -S expect -f
#!/usr/bin/expect -f
spawn ./prybar-sqlite -i
expect -gl "-- Loading resources from /tmp/sqlite-config*\r\nSQLite version 3.27.2*\r\nEnter \".help\" for usage hints.\r\n--> "

View File

@ -1,4 +1,4 @@
#!/usr/bin/env -S expect -f
#!/usr/bin/expect -f
spawn ./prybar-sqlite -q -i
expect "^--> "

View File

@ -1,4 +1,4 @@
#!/usr/bin/env -S expect -f
#!/usr/bin/expect -f
spawn ./prybar-sqlite -q -i ./test_files/hello.sql
expect -- "^hey there\r

View File

@ -1,4 +1,4 @@
#!/usr/bin/env -S expect -f
#!/usr/bin/expect -f
set timeout -1
spawn ./prybar-tcl -q -i

View File

@ -1,4 +1,4 @@
#!/usr/bin/env -S expect -f
#!/usr/bin/expect -f
set timeout -1
spawn ./prybar-tcl -q -i ./test_files/hello_tcl.tcl

View File

@ -1,4 +1,4 @@
#!/usr/bin/env -S expect -f
#!/usr/bin/expect -f
set timeout -1
spawn ./prybar-tcl -q -i

View File

@ -1,4 +1,4 @@
#!/usr/bin/env -S expect -f
#!/usr/bin/expect -f
set timeout -1
spawn ./prybar-tcl -q -i ./test-files/hi_julia.jl

View File

@ -1,4 +1,4 @@
#!/usr/bin/env -S expect -f
#!/usr/bin/expect -f
set timeout -1
spawn ./prybar-tcl -q -i