mirror of
https://github.com/ilyakooo0/prybar.git
synced 2024-11-20 19:38:05 +03:00
Copy prybar assets into Nix derivation
Fix prybar Nix tests
This commit is contained in:
parent
922f628219
commit
52e368173a
@ -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
|
||||
'';
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env bash
|
||||
#!/bin/bash
|
||||
stdin="/tmp/prybar_stdin"
|
||||
stdout="/tmp/prybar_stdout"
|
||||
stderr="/tmp/prybar_stderr"
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env -S expect -f
|
||||
#!/usr/bin/expect -f
|
||||
|
||||
# ignore ANSI escape sequences
|
||||
set _ "(?:.*?)"
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env -S expect -f
|
||||
#!/usr/bin/expect -f
|
||||
|
||||
# ignore ANSI escape sequences
|
||||
set _ "(?:.*?)"
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env -S expect -f
|
||||
#!/usr/bin/expect -f
|
||||
|
||||
# ignore ANSI escape sequences
|
||||
set _ "(?:.*?)"
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env -S expect -f
|
||||
#!/usr/bin/expect -f
|
||||
|
||||
# ignore ANSI escape sequences
|
||||
set _ "(?:.*?)"
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env -S expect -f
|
||||
#!/usr/bin/expect -f
|
||||
|
||||
# ignore ANSI escape sequences
|
||||
set _ "(?:.*?)"
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env -S expect -f
|
||||
#!/usr/bin/expect -f
|
||||
|
||||
# ignore ANSI escape sequences
|
||||
set _ "(?:.*?)"
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env -S expect -f
|
||||
#!/usr/bin/expect -f
|
||||
|
||||
# ignore ANSI escape sequences
|
||||
set _ "(?:.*?)"
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env -S expect -f
|
||||
#!/usr/bin/expect -f
|
||||
|
||||
# ignore ANSI escape sequences
|
||||
set _ "(?:.*?)"
|
||||
|
@ -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")}
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env -S expect -f
|
||||
#!/usr/bin/expect -f
|
||||
|
||||
spawn ./prybar-clojure ./test_files/hello.clj
|
||||
expect eof
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env -S expect -f
|
||||
#!/usr/bin/expect -f
|
||||
|
||||
set timeout -1
|
||||
spawn ./prybar-julia -q -i
|
||||
|
@ -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.
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env -S expect -f
|
||||
#!/usr/bin/expect -f
|
||||
|
||||
set timeout -1
|
||||
spawn ./prybar-julia -q -i
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env -S expect -f
|
||||
#!/usr/bin/expect -f
|
||||
|
||||
set timeout -1
|
||||
spawn ./prybar-julia -q -i
|
||||
|
@ -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
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env -S expect -f
|
||||
#!/usr/bin/expect -f
|
||||
|
||||
set timeout -1
|
||||
spawn ./prybar-lua -q -i
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env -S expect -f
|
||||
#!/usr/bin/expect -f
|
||||
|
||||
set timeout -1
|
||||
spawn ./prybar-lua -q -i
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env -S expect -f
|
||||
#!/usr/bin/expect -f
|
||||
|
||||
set timeout -1
|
||||
spawn ./prybar-lua -q -i
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env -S expect -f
|
||||
#!/usr/bin/expect -f
|
||||
|
||||
set timeout -1
|
||||
spawn ./prybar-lua -q -i
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env -S expect -f
|
||||
#!/usr/bin/expect -f
|
||||
|
||||
set timeout -1
|
||||
spawn ./prybar-nodejs -i -q
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env -S expect -f
|
||||
#!/usr/bin/expect -f
|
||||
|
||||
set timeout -1
|
||||
spawn ./prybar-nodejs -i -q
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env -S expect -f
|
||||
#!/usr/bin/expect -f
|
||||
|
||||
set timeout -1
|
||||
spawn ./prybar-nodejs -i -q
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env -S expect -f
|
||||
#!/usr/bin/expect -f
|
||||
|
||||
set timeout -1
|
||||
spawn ./prybar-nodejs -q -e 1+1
|
||||
|
@ -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
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env -S expect -f
|
||||
#!/usr/bin/expect -f
|
||||
|
||||
set timeout -1
|
||||
spawn ./prybar-nodejs -i
|
||||
|
@ -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
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env -S expect -f
|
||||
#!/usr/bin/expect -f
|
||||
|
||||
set timeout -1
|
||||
spawn ./prybar-nodejs -i -q
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env -S expect -f
|
||||
#!/usr/bin/expect -f
|
||||
|
||||
set timeout -1
|
||||
spawn ./prybar-nodejs -i -q
|
||||
|
@ -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
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env -S expect -f
|
||||
#!/usr/bin/expect -f
|
||||
|
||||
set timeout -1
|
||||
spawn ./prybar-nodejs -i -q
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env -S expect -f
|
||||
#!/usr/bin/expect -f
|
||||
|
||||
set timeout -1
|
||||
spawn ./prybar-nodejs -i -q
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env -S expect -f
|
||||
#!/usr/bin/expect -f
|
||||
|
||||
set timeout -1
|
||||
spawn ./prybar-nodejs -i -q
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env -S expect -f
|
||||
#!/usr/bin/expect -f
|
||||
|
||||
set timeout -1
|
||||
spawn ./prybar-nodejs -q -c 1+1
|
||||
|
@ -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
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env -S expect -f
|
||||
#!/usr/bin/expect -f
|
||||
|
||||
set timeout -1
|
||||
spawn ./prybar-nodejs -i -q -ps1 custom
|
||||
|
@ -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
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env -S expect -f
|
||||
#!/usr/bin/expect -f
|
||||
|
||||
spawn ./prybar-ocaml -q -i
|
||||
match_max 100000
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env -S expect -f
|
||||
#!/usr/bin/expect -f
|
||||
|
||||
spawn ./prybar-ocaml -q -e 1+1
|
||||
match_max 100000
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env -S expect -f
|
||||
#!/usr/bin/expect -f
|
||||
|
||||
spawn ./prybar-ocaml -e 1+1
|
||||
match_max 100000
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env -S expect -f
|
||||
#!/usr/bin/expect -f
|
||||
|
||||
spawn ./prybar-ocaml -q -i -ps1 ">>"
|
||||
match_max 100000
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env -S expect -f
|
||||
#!/usr/bin/expect -f
|
||||
|
||||
spawn ./prybar-ocaml -q -i -ps2 continuation
|
||||
match_max 100000
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env -S expect -f
|
||||
#!/usr/bin/expect -f
|
||||
|
||||
spawn ./prybar-ocaml -q -i
|
||||
match_max 100000
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env -S expect -f
|
||||
#!/usr/bin/expect -f
|
||||
|
||||
spawn ./prybar-python2 -i
|
||||
match_max 100000
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env -S expect -f
|
||||
#!/usr/bin/expect -f
|
||||
|
||||
spawn ./prybar-python2 -q -c print('hello')
|
||||
match_max 100000
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env -S expect -f
|
||||
#!/usr/bin/expect -f
|
||||
|
||||
spawn ./prybar-python2 -q -i
|
||||
match_max 100000
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env -S expect -f
|
||||
#!/usr/bin/expect -f
|
||||
|
||||
spawn ./prybar-python2 -e 1+1
|
||||
match_max 100000
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env -S expect -f
|
||||
#!/usr/bin/expect -f
|
||||
|
||||
spawn ./prybar-python2 -i -ps1 somethingelse
|
||||
match_max 100000
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env -S expect -f
|
||||
#!/usr/bin/expect -f
|
||||
|
||||
spawn ./prybar-python2 -i -ps2 continuation
|
||||
match_max 100000
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env -S expect -f
|
||||
#!/usr/bin/expect -f
|
||||
|
||||
spawn ./prybar-python2 -q -i
|
||||
match_max 100000
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env -S expect -f
|
||||
#!/usr/bin/expect -f
|
||||
|
||||
spawn ./prybar-python2 -q -i
|
||||
match_max 100000
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env -S expect -f
|
||||
#!/usr/bin/expect -f
|
||||
|
||||
set timeout -1
|
||||
spawn ./prybar-python3 -i -q
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env -S expect -f
|
||||
#!/usr/bin/expect -f
|
||||
|
||||
set timeout -1
|
||||
spawn ./prybar-python3 -e 1+1
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env -S expect -f
|
||||
#!/usr/bin/expect -f
|
||||
|
||||
set timeout -1
|
||||
spawn ./prybar-python3 -i -q
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env -S expect -f
|
||||
#!/usr/bin/expect -f
|
||||
|
||||
set timeout -1
|
||||
spawn ./prybar-python3 -c print('hello')
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env -S expect -f
|
||||
#!/usr/bin/expect -f
|
||||
|
||||
set timeout -1
|
||||
spawn ./prybar-python3 -i -q -ps1 custom
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env -S expect -f
|
||||
#!/usr/bin/expect -f
|
||||
|
||||
set timeout -1
|
||||
spawn ./prybar-python3 -i -q -ps2 custom
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env -S expect -f
|
||||
#!/usr/bin/expect -f
|
||||
|
||||
set timeout -1
|
||||
spawn ./prybar-python3 -i
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env -S expect -f
|
||||
#!/usr/bin/expect -f
|
||||
|
||||
# red is currently nondeterministic
|
||||
exit 0
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env -S expect -f
|
||||
#!/usr/bin/expect -f
|
||||
|
||||
spawn ./prybar-sqlite -q -i
|
||||
expect -- "^--> "
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env -S expect -f
|
||||
#!/usr/bin/expect -f
|
||||
|
||||
spawn ./prybar-sqlite -e "select 1+1;"
|
||||
expect ^2
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env -S expect -f
|
||||
#!/usr/bin/expect -f
|
||||
|
||||
spawn ./prybar-sqlite -c "select 1+1;"
|
||||
expect ^eof
|
||||
|
@ -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--> "
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env -S expect -f
|
||||
#!/usr/bin/expect -f
|
||||
|
||||
spawn ./prybar-sqlite -q -i
|
||||
expect "^--> "
|
||||
|
@ -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
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env -S expect -f
|
||||
#!/usr/bin/expect -f
|
||||
|
||||
set timeout -1
|
||||
spawn ./prybar-tcl -q -i
|
||||
|
@ -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
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env -S expect -f
|
||||
#!/usr/bin/expect -f
|
||||
|
||||
set timeout -1
|
||||
spawn ./prybar-tcl -q -i
|
||||
|
@ -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
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env -S expect -f
|
||||
#!/usr/bin/expect -f
|
||||
|
||||
set timeout -1
|
||||
spawn ./prybar-tcl -q -i
|
||||
|
Loading…
Reference in New Issue
Block a user