| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 |
|
| 19 | (use-modules (guix tests)
|
| 20 | (srfi srfi-26)
|
| 21 | (srfi srfi-64))
|
| 22 |
|
| 23 | (define %project-root
|
| 24 | (dirname (dirname (canonicalize-path (or (current-filename))))))
|
| 25 |
|
| 26 | |
| 27 | |
| 28 | (load (string-append %project-root "/gnu/packages/ld-wrapper.in"))
|
| 29 | (define ld-wrapper-module (resolve-module '(gnu build-support ld-wrapper)))
|
| 30 | (define library-files-linked (module-ref ld-wrapper-module 'library-files-linked))
|
| 31 |
|
| 32 | (define %dummy-library-prefix "/gnu/store/...-dummy-0.0.0/lib")
|
| 33 |
|
| 34 | (test-begin "ld-wrapper")
|
| 35 |
|
| 36 | (define lugaru-link-arguments
|
| 37 | '("-Wall" "-Wextra" "-Wno-parentheses" "-pedantic" "--std=gnu++11" "-O2" "-g"
|
| 38 | "-DNDEBUG" "-rdynamic" "-Wl,--dependency-file=CMakeFiles/lugaru.dir/link.d"
|
| 39 | "CMakeFiles/lugaru.dir/Source/main.cpp.o"
|
| 40 | "CMakeFiles/lugaru.dir/Source/Animation/Animation.cpp.o"
|
| 41 | "-o" "lugaru" "-lopenal" "-lpng" "-ljpeg" "-lz" "-lSDL2"
|
| 42 | "-lGL" "-lGLU" "-lvorbisfile" "-logg"))
|
| 43 |
|
| 44 | (define lugaru-link-libraries
|
| 45 | (map (cut string-append "lib" <> ".so")
|
| 46 | '("openal" "png" "jpeg" "z" "SDL2" "GL" "GLU" "vorbisfile" "ogg")))
|
| 47 |
|
| 48 | (test-equal "library files linked"
|
| 49 | (map (cut string-append %dummy-library-prefix "/" <>)
|
| 50 | lugaru-link-libraries)
|
| 51 | (mock ((guile) search-path
|
| 52 | (lambda (_ library)
|
| 53 | (string-append %dummy-library-prefix "/" library)))
|
| 54 | (library-files-linked lugaru-link-arguments "dummy:library:path")))
|
| 55 |
|
| 56 | (test-end)
|