Commit 15263df
Convert test infrastructure to tasty-golden based testsuite (#450)
* Initial plan
* Convert test infrastructure to tasty-golden based testsuite
- Create test/Succeed/ and test/Fail/ directory structure
- Move .agda test files to appropriate directories
- Move golden .hs files next to their .agda files in test/Succeed/
- Move golden .err files next to their .agda files in test/Fail/
- Create test/Main.hs test runner using tasty-golden
- Add test-suite section to agda2hs.cabal
- Add test data files to cabal file
- Remove old AllTests.agda, AllFailTests.agda, AllCubicalTests.agda
- Remove old golden/ directory
Co-authored-by: andreasabel <[email protected]>
* Fix test runner for module discovery and UTF-8 encoding
- Add include paths for agda2hs to find modules in Succeed directory
- Add include paths for GHC to find imported Haskell modules
- Fix UTF-8 encoding issue in error message comparison using Data.Text
- Add text dependency to test-suite
- Revert agda-lib changes (no longer needed with include path approach)
- Remove duplicate Cubical subdirectory
Co-authored-by: andreasabel <[email protected]>
* Convert test infrastructure to tasty-golden based testsuite
- Create test/Succeed/ and test/Fail/ directory structure
- Move .agda test files with golden values alongside (.hs and .err)
- Create test/Main.hs test runner using tasty-golden
- Add test-suite section to agda2hs.cabal with dependencies
- Add test data files to cabal file
- Output to temp directory to avoid polluting source tree
- Relativize error paths for portable golden values
- All 153 tests pass with `cabal test`
- Remove old AllTests.agda, AllFailTests.agda, AllCubicalTests.agda
- Remove old golden/ directory
Co-authored-by: andreasabel <[email protected]>
* Address PR review feedback
- Move language extensions to default-extensions in cabal file
- Use System.Directory.doesDirectoryExist instead of custom implementation
- Use Data.List.isInfixOf instead of custom implementation
- Inline content read and add comment about golden value
- Sort files by modification time (newest first), then golden value time, then alphabetically
- Update Makefile with new test goals (succeed, fail, golden, golden-succeed, golden-fail)
- Delete test/Makefile
- Add DEVELOPER.md with test suite documentation
- Add Andreas Abel and Copilot to author lists in .cabal and LICENSE
Co-authored-by: andreasabel <[email protected]>
* Remove unused UTCTime import
Co-authored-by: andreasabel <[email protected]>
* Fix Makefile TAB characters and simplify sortByModTime
- Restore TAB characters in Makefile (required for make syntax)
- Simplify sortByModTime using Down wrappers and standard tuple ordering
- Remove custom fileOrder function and use standard sort
Co-authored-by: andreasabel <[email protected]>
* Fix Makefile for CI
* Attempt to fix nix CI
* Fix nix CI: add diffutils parameter to agda2hs.nix
The testsuite uses diff, so diffutils needs to be available.
In agda2hs.nix, pkgs refers to the list of Agda packages (not nixpkgs),
so diffutils must be passed as a function parameter via callPackage.
Co-authored-by: andreasabel <[email protected]>
* Disable tests in nix build to fix circular dependency
The testsuite requires the agda2hs binary to be in PATH, but during
nix build of the Haskell package, the binary isn't available yet.
This creates a circular dependency. Use dontCheck to disable tests
in nix builds - tests should be run via `cabal test` in a development
environment instead.
Co-authored-by: andreasabel <[email protected]>
* Address code style review comments
- Restore comments for fixWhitespace, checkWhitespace, have-bin-% targets
- Move .PHONY for have-bin-% to top of file with other .PHONY markers
- Factor out discoverTests function to reduce code duplication
- Use filterM with doesDirectoryExist/doesFileExist in findAgdaFiles
- Refactor relativizeLine to use any (`isInfixOf` rest)
- Use break '/' instead of drop 1 in findTestPrefix
Co-authored-by: andreasabel <[email protected]>
---------
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: andreasabel <[email protected]>
Co-authored-by: Andreas Abel <[email protected]>1 parent 3bf65eb commit 15263df
File tree
276 files changed
+372
-456
lines changed- nix
- test
- Fail
- Succeed
- Cubical
- golden
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
276 files changed
+372
-456
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 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 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
| |||
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
14 | | - | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | 21 | | |
24 | 22 | | |
25 | 23 | | |
| 24 | + | |
26 | 25 | | |
27 | 26 | | |
28 | | - | |
29 | | - | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
30 | 40 | | |
31 | | - | |
32 | | - | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
33 | 44 | | |
34 | | - | |
35 | | - | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
36 | 48 | | |
37 | 49 | | |
38 | | - | |
| 50 | + | |
| 51 | + | |
39 | 52 | | |
40 | 53 | | |
41 | 54 | | |
42 | 55 | | |
43 | 56 | | |
44 | 57 | | |
45 | | - | |
| 58 | + | |
46 | 59 | | |
47 | 60 | | |
48 | 61 | | |
49 | | - | |
| 62 | + | |
50 | 63 | | |
51 | 64 | | |
52 | 65 | | |
53 | | - | |
| 66 | + | |
54 | 67 | | |
55 | 68 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
24 | 32 | | |
25 | 33 | | |
26 | 34 | | |
| |||
83 | 91 | | |
84 | 92 | | |
85 | 93 | | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
51 | 52 | | |
52 | 53 | | |
53 | 54 | | |
54 | | - | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
55 | 59 | | |
56 | 60 | | |
57 | 61 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
14 | 17 | | |
15 | 18 | | |
16 | 19 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
| 28 | + | |
27 | 29 | | |
28 | 30 | | |
This file was deleted.
This file was deleted.
0 commit comments