on 43dda21 help sign in
streamly/bin/run-repl-quick.sh
113 lines 3.2 kB history raw
1#!/usr/bin/env bash
3# XXX Having a repl-ish option on packcheck can be very useful for quick type
4# checking. Running that in a loop in a smart way will work like ghcid.
6# The idea is to have an extremely light version of run-ci.sh
7# This can be very helpful on any refactoring change.
9# This script should be majorly improved but it solves my use case for the time
10# being.
12set -e
14SCRIPT_DIR=$(dirname $0)
16STREAMLY_VERSION=0.8.2
17BENCH_REPORT_DIR=benchmark/bench-report
18source $SCRIPT_DIR/targets.sh
20#------------------------------------------------------------------------------
21# Script
22#------------------------------------------------------------------------------
24print_help () {
25 echo "Usage: $0"
26 echo
27 echo "Very dumb script."
28 echo "Currently runs everything in the repl and exits."
29 echo "Useful for type checking and displaying warnings."
30 echo
31 exit
34#------------------------------------------------------------------------------
35# Helper functions
36#------------------------------------------------------------------------------
38run_build_repl () {
39 local prefix=$1
40 local targets=$2
41 local COMPONENTS
42 local c
44 for c in $targets
45 do
46 CABAL_BUILD_OPTIONS=$(dev_build "--flag dev")
47 echo "|--------------------------------------------------------------------"
48 echo "|" $CABAL_EXECUTABLE repl "$prefix:$c" $CABAL_BUILD_OPTIONS <<< :q
49 echo "|--------------------------------------------------------------------"
50 run_verbose $CABAL_EXECUTABLE repl "$prefix:$c" $CABAL_BUILD_OPTIONS <<< :q
51 done
54#------------------------------------------------------------------------------
55# Setup
56#------------------------------------------------------------------------------
58source $BENCH_REPORT_DIR/bin/build-lib.sh
60USE_GIT_CABAL=0
61set_common_vars
63#------------------------------------------------------------------------------
64# Library
65#------------------------------------------------------------------------------
67# XXX Ideally run for all the valid flag combinations
68CABAL_BUILD_OPTIONS=""
69run_verbose $CABAL_EXECUTABLE repl $CABAL_BUILD_OPTIONS <<< :q
71CABAL_BUILD_OPTIONS="--flag dev"
72run_verbose $CABAL_EXECUTABLE repl $CABAL_BUILD_OPTIONS <<< :q
74CABAL_BUILD_OPTIONS="--flag streamk"
75run_verbose $CABAL_EXECUTABLE repl $CABAL_BUILD_OPTIONS <<< :q
77CABAL_BUILD_OPTIONS="--flag use-c-malloc"
78run_verbose $CABAL_EXECUTABLE repl $CABAL_BUILD_OPTIONS <<< :q
80#------------------------------------------------------------------------------
81# Benchmarks
82#------------------------------------------------------------------------------
84RUNNING_BENCHMARKS=y
85RUNNING_TESTS=
87RUNNING_DEVBUILD=
88targets
89TARGETS="$(all_grp)"
90run_build_repl "bench" "$TARGETS"
93RUNNING_DEVBUILD=y
94targets
95TARGETS="$(all_grp)"
96run_build_repl "bench" "$TARGETS"
98#------------------------------------------------------------------------------
99# Tests
100#------------------------------------------------------------------------------
102RUNNING_TESTS=y
103RUNNING_BENCHMARKS=
105RUNNING_DEVBUILD=
106targets
107TARGETS="$(all_grp)"
108run_build_repl "test" "$TARGETS"
110RUNNING_DEVBUILD=y
111targets
112TARGETS="$(all_grp)"
113run_build_repl "test" "$TARGETS"