#!/bin/sh # 1) Run only in .external mode because there are some issues in loading ghc into # itself with the internal interpreter. Didn't investigate thoroughly. # # 2) Since this test is named `....no-tmp-dir....` then it will be run in the root of the tree # # 3) Grep out the `BreakFound` word. It doesn't matter for the test and it is # too prone to changing because it reports source lines of the actual debugger # source, which we change all the time (unlike testsuite programs). # # 3.1) Grep out all `[27 of 53] Compiling ...` lines. Everytime we added a # module it would force the test to be updated and was prone to conflicts. # # 4) Normalize cabal autogen paths (e.g. `Paths_haskell_debugger.hs`). # It's not immediately clear why these go in .cache/hie-bios/... rather than in # $HDB_CACHE_DIR, but I guess it's an autogen thing rather than the actual # compilation artifacts cache (.hi, ...) # # 5) When testing the sdist (just the packaged things), the root doesn't have a hie.yaml. # Add one temporarily # Dedicated HIE file for self-debug tests. yaml_file=hie-self-debug-test.yaml created_yaml=false if [ ! -f "$yaml_file" ]; then printf 'cradle:\n cabal:\n component: "all"\n' > "$yaml_file" created_yaml=true; fi $HDB -v0 --cradle-file="$yaml_file" hdb/Main.hs < "test/golden/self-debug-cli/self-debug-cli.hdb-stdin" 2>&1 \ | grep -v "BreakFound" \ | grep -v "] Compiling" \ | grep -v "ld: warning: -U option is redundant when using -undefined dynamic_lookup" \ | sed \ -e 's|[^ ]*/Paths_haskell_debugger.hs|/Paths_haskell_debugger.hs|g' \ -e 's|haskell-debugger-[0-9.][0-9.]*-inplace|haskell-debugger--inplace|g' \ -e 's|haskell-debugger-view-[0-9.][0-9.]*-inplace|haskell-debugger-view--inplace|g' if [ $created_yaml = true ]; then rm "$yaml_file" fi