-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathself-debug-cli.no-tmp-dir.external.hdb-test
More file actions
43 lines (37 loc) · 1.73 KB
/
self-debug-cli.no-tmp-dir.external.hdb-test
File metadata and controls
43 lines (37 loc) · 1.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/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" \
| sed \
-e 's|[^ ]*/Paths_haskell_debugger.hs|<AUTOGEN-DIR>/Paths_haskell_debugger.hs|g' \
-e 's|haskell-debugger-[0-9.][0-9.]*-inplace|haskell-debugger-<VERSION>-inplace|g' \
-e 's|haskell-debugger-view-[0-9.][0-9.]*-inplace|haskell-debugger-view-<VERSION>-inplace|g'
if [ $created_yaml = true ]; then
rm "$yaml_file"
fi