[go: up one dir, main page]

Menu

[553f75]: / test / scripts.scm  Maximize  Restore  History

Download this file

103 lines (81 with data), 3.9 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
 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
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
;; Test utility scripts
(use gauche.test)
(use gauche.process)
(use file.util)
(test-start "utility scripts")
(define *nulldev*
(cond-expand
[gauche.os.windows "NUL"]
[else "/dev/null"]))
;;=======================================================================
(test-section "gauche-install")
(define (run-install . args)
(run-process `("./gosh" "-ftest" "gauche-install.in" ,@args)
:output *nulldev* :wait #t))
(remove-files "test.o" "test1.o")
(test* "-d" #t
(begin (run-install "-d" "test1.o/dest")
(file-is-directory? "test1.o/dest")))
(create-directory-tree "."
`(test.o ((bin ((command1 ,(make-string 20000))
(command2 ,(make-string 20000))))
(lib ((lib1 ,(make-string 1000000))
(lib2 ,(make-string 500000))))
(etc ((conf1 ,(make-string 1000)))))))
(test* "file -> file" #t
(begin (run-install "-m" "444" "test.o/lib/lib1" "test1.o/dest/lib1")
(and (file-is-regular? "test1.o/dest/lib1")
(= (file-perm "test1.o/dest/lib1") #o444)
(file-equal? "test.o/lib/lib1" "test1.o/dest/lib1"))))
(remove-files "test1.o/dest/lib1")
(test* "files -> dir" #t
(begin (run-install "-m" "444" "test.o/lib/lib1" "test.o/lib/lib2"
"test1.o/dest")
(and (file-is-regular? "test1.o/dest/lib1")
(file-is-regular? "test1.o/dest/lib2")
(= (file-perm "test1.o/dest/lib1")
(file-perm "test1.o/dest/lib1")
#o444)
(file-equal? "test.o/lib/lib1" "test1.o/dest/lib1")
(file-equal? "test.o/lib/lib2" "test1.o/dest/lib2"))))
(remove-files "test1.o/dest/lib1" "test1.o/dest/lib2")
(test* "-T" #t
(begin (run-install "-T" "test1.o/dest" "-m" "555"
"test.o/bin/command1"
"test.o/bin/command2")
(and (= (file-perm "test1.o/dest/test.o/bin/command1")
(file-perm "test1.o/dest/test.o/bin/command2")
(cond-expand
[gauche.os.windows #o444]
[else #o555]))
(file-equal? "test.o/bin/command1"
"test1.o/dest/test.o/bin/command1")
(file-equal? "test.o/bin/command2"
"test1.o/dest/test.o/bin/command2"))))
(test* "-U" #t
(begin (run-install "-U" "test1.o/dest" "-m" "555"
"test.o/bin/command1"
"test.o/bin/command2")
(and (not (file-exists? "test1.o/dest/test.o/bin/command1"))
(not (file-exists? "test1.o/dest/test.o/bin/command2")))))
(test* "-T -p" #t
(begin (run-install "-T" "test1.o/dest" "-m" "555" "-p" "test.o"
"test.o/bin/command1"
"test.o/bin/command2")
(and (= (file-perm "test1.o/dest/bin/command1")
(file-perm "test1.o/dest/bin/command2")
(cond-expand
[gauche.os.windows #o444]
[else #o555]))
(file-equal? "test.o/bin/command1"
"test1.o/dest/bin/command1")
(file-equal? "test.o/bin/command2"
"test1.o/dest/bin/command2"))))
(test* "-U -p" #t
(begin (run-install "-U" "test1.o/dest" "-m" "555" "-p" "test.o"
"test.o/bin/command1"
"test.o/bin/command2")
(and (not (file-exists? "test1.o/dest/bin/command1"))
(not (file-exists? "test1.o/dest/bin/command2")))))
(remove-files "test.o" "test1.o")
(test-end)