Skip to content

Commit

Permalink
DEBUG printenv
Browse files Browse the repository at this point in the history
  • Loading branch information
Rufflewind committed Jan 6, 2025
1 parent 6780dc1 commit 4b88b0d
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 42 deletions.
12 changes: 2 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,8 @@ jobs:
fail-fast: false
matrix:
include:
- { os: macOS-13, stack: lts-15.3, stack-extra-deps: "bytestring-0.11.3.0, file-io-0.1.4, filepath-1.4.100.0, unix-2.8.0.0" }
- { os: macos-latest, stack: lts-22.7, stack-extra-deps: "bytestring-0.11.5.3, file-io-0.1.4, filepath-1.5.2.0, os-string-2.0.2, unix-2.8.5.1", stack-package-flags: "{directory: {os-string: true}, file-io: {os-string: true}, unix: {os-string: true}}", ghc-flags: -Werror=deprecations }
- { os: ubuntu-latest, ghc: 8.10.7, cabal: 3.8.1.0 }
- { os: ubuntu-latest, ghc: 9.0.2, cabal: 3.8.1.0 }
- { os: ubuntu-latest, ghc: 9.2.4, cabal: 3.8.1.0 }
- { os: ubuntu-latest, ghc: 9.4.3, cabal: 3.8.1.0 }
- { os: ubuntu-latest, ghc: latest, cabal: latest, cabal-package-flags: +os-string, ghc-flags: -Werror=deprecations }
- { os: windows-latest, stack: lts-15.3, stack-extra-deps: "bytestring-0.11.3.0, file-io-0.1.4, filepath-1.4.100.0, time-1.9.3, Win32-2.13.3.0", overrides: "before_prepare() { sed -i.bak -e /CreateSymbolicLinkW/d -e /GetFinalPathNameByHandleW/d configure.ac; }" }
- { os: windows-latest, stack: lts-17.5, stack-extra-deps: "bytestring-0.11.3.0, file-io-0.1.4, filepath-1.4.100.0, time-1.9.3, Win32-2.13.3.0" }
- { os: windows-latest, stack: lts-22.7, stack-extra-deps: "bytestring-0.11.5.3, file-io-0.1.4, filepath-1.5.2.0, os-string-2.0.2, time-1.14, Win32-2.14.0.0", stack-package-flags: "{directory: {os-string: true}, file-io: {os-string: true}, Win32: {os-string: true}}", ghc-flags: -Werror=deprecations }
- { os: ubuntu-latest, ghc: 9.10.1, cabal: 3.14.1.0, cabal-package-flags: +os-string, ghc-flags: -Werror=deprecations }
- { os: ubuntu-latest, ghc: 9.12.1, cabal: 3.14.1.0, cabal-package-flags: +os-string, ghc-flags: -Werror=deprecations }
runs-on: ${{ matrix.os }}
env:
CABAL_PACKAGE_FLAGS: ${{ matrix.cabal-package-flags }}
Expand Down
5 changes: 5 additions & 0 deletions print_envs.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module Main where
import System.Environment
import Data.List

main = print =<< fmap (sort . fmap fst) getEnvironment
11 changes: 11 additions & 0 deletions printenvs.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#include <stdio.h>
#include <string.h>

extern char **environ;

int main(void) {
int i;
for (i = 0; environ[i]; ++i) {
printf("printenvs: %s\n", strtok(environ[i], "="));
}
}
70 changes: 39 additions & 31 deletions tests/Main.hs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
module Main (main) where
import System.Environment
import Data.List
import qualified Util as T
import qualified CanonicalizePath

Check failure on line 5 in tests/Main.hs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 9.10.1, 3.14.1.0, +os-string, -Werror=deprecations)

The qualified import of ‘CanonicalizePath’ is redundant

Check failure on line 5 in tests/Main.hs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 9.12.1, 3.14.1.0, +os-string, -Werror=deprecations)

The qualified import of ‘CanonicalizePath’ is redundant
import qualified CopyFile001

Check failure on line 6 in tests/Main.hs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 9.10.1, 3.14.1.0, +os-string, -Werror=deprecations)

The qualified import of ‘CopyFile001’ is redundant

Check failure on line 6 in tests/Main.hs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 9.12.1, 3.14.1.0, +os-string, -Werror=deprecations)

The qualified import of ‘CopyFile001’ is redundant
Expand Down Expand Up @@ -34,34 +36,40 @@ import qualified Xdg

main :: IO ()
main = T.testMain $ \ _t -> do
T.isolatedRun _t "CanonicalizePath" CanonicalizePath.main
T.isolatedRun _t "CopyFile001" CopyFile001.main
T.isolatedRun _t "CopyFile002" CopyFile002.main
T.isolatedRun _t "CopyFileWithMetadata" CopyFileWithMetadata.main
T.isolatedRun _t "CreateDirectory001" CreateDirectory001.main
T.isolatedRun _t "CreateDirectoryIfMissing001" CreateDirectoryIfMissing001.main
T.isolatedRun _t "CurrentDirectory001" CurrentDirectory001.main
T.isolatedRun _t "Directory001" Directory001.main
T.isolatedRun _t "DoesDirectoryExist001" DoesDirectoryExist001.main
T.isolatedRun _t "DoesPathExist" DoesPathExist.main
T.isolatedRun _t "FileTime" FileTime.main
T.isolatedRun _t "FindFile001" FindFile001.main
T.isolatedRun _t "GetDirContents001" GetDirContents001.main
T.isolatedRun _t "GetDirContents002" GetDirContents002.main
T.isolatedRun _t "GetFileSize" GetFileSize.main
T.isolatedRun _t "GetHomeDirectory001" GetHomeDirectory001.main
T.isolatedRun _t "GetHomeDirectory002" GetHomeDirectory002.main
T.isolatedRun _t "GetPermissions001" GetPermissions001.main
T.isolatedRun _t "LongPaths" LongPaths.main
T.isolatedRun _t "MakeAbsolute" MakeAbsolute.main
T.isolatedRun _t "MinimizeNameConflicts" MinimizeNameConflicts.main
T.isolatedRun _t "PathIsSymbolicLink" PathIsSymbolicLink.main
T.isolatedRun _t "RemoveDirectoryRecursive001" RemoveDirectoryRecursive001.main
T.isolatedRun _t "RemovePathForcibly" RemovePathForcibly.main
T.isolatedRun _t "RenameDirectory" RenameDirectory.main
T.isolatedRun _t "RenameFile001" RenameFile001.main
T.isolatedRun _t "RenamePath" RenamePath.main
T.isolatedRun _t "Simplify" Simplify.main
T.isolatedRun _t "T8482" T8482.main
T.isolatedRun _t "WithCurrentDirectory" WithCurrentDirectory.main
T.isolatedRun _t "Xdg" Xdg.main
putStrLn "!!!!!!!!!!!! 1"
print =<< fmap (sort . fmap fst) getEnvironment
-- T.isolatedRun _t "CanonicalizePath" CanonicalizePath.main
-- T.isolatedRun _t "CopyFile001" CopyFile001.main
-- T.isolatedRun _t "CopyFile002" CopyFile002.main
-- T.isolatedRun _t "CopyFileWithMetadata" CopyFileWithMetadata.main
-- T.isolatedRun _t "CreateDirectory001" CreateDirectory001.main
-- T.isolatedRun _t "CreateDirectoryIfMissing001" CreateDirectoryIfMissing001.main
-- T.isolatedRun _t "CurrentDirectory001" CurrentDirectory001.main
-- T.isolatedRun _t "Directory001" Directory001.main
-- T.isolatedRun _t "DoesDirectoryExist001" DoesDirectoryExist001.main
-- T.isolatedRun _t "DoesPathExist" DoesPathExist.main
-- T.isolatedRun _t "FileTime" FileTime.main
-- T.isolatedRun _t "FindFile001" FindFile001.main
-- putStrLn "!!!!!!!!!!!! 2"
-- print =<< fmap (sort . fmap fst) getEnvironment
-- T.isolatedRun _t "GetDirContents001" GetDirContents001.main
-- T.isolatedRun _t "GetDirContents002" GetDirContents002.main
-- T.isolatedRun _t "GetFileSize" GetFileSize.main
-- T.isolatedRun _t "GetHomeDirectory001" GetHomeDirectory001.main
-- T.isolatedRun _t "GetHomeDirectory002" GetHomeDirectory002.main
-- T.isolatedRun _t "GetPermissions001" GetPermissions001.main
-- T.isolatedRun _t "LongPaths" LongPaths.main
-- T.isolatedRun _t "MakeAbsolute" MakeAbsolute.main
-- T.isolatedRun _t "MinimizeNameConflicts" MinimizeNameConflicts.main
-- T.isolatedRun _t "PathIsSymbolicLink" PathIsSymbolicLink.main
-- T.isolatedRun _t "RemoveDirectoryRecursive001" RemoveDirectoryRecursive001.main
-- T.isolatedRun _t "RemovePathForcibly" RemovePathForcibly.main
-- T.isolatedRun _t "RenameDirectory" RenameDirectory.main
-- T.isolatedRun _t "RenameFile001" RenameFile001.main
-- T.isolatedRun _t "RenamePath" RenamePath.main
-- T.isolatedRun _t "Simplify" Simplify.main
-- T.isolatedRun _t "T8482" T8482.main
-- T.isolatedRun _t "WithCurrentDirectory" WithCurrentDirectory.main
-- putStrLn "!!!!!!!!!!!! 3"
-- print =<< fmap (sort . fmap fst) getEnvironment
-- T.isolatedRun _t "Xdg" Xdg.main
2 changes: 1 addition & 1 deletion tools/testscript
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ build() {
$stack sdist
else
testflags=`printf " %s" "$testflags" | sed "s/ / --test-option=/g"`
cabal v2-test --keep-going --test-show-details=streaming $testflags
cabal -v v2-test --keep-going --test-show-details=streaming $testflags
cabal check
cabal v2-sdist
cabal v1-install --force-reinstalls --run-tests dist-newstyle/sdist/*-*.tar.gz
Expand Down

0 comments on commit 4b88b0d

Please sign in to comment.