2018-07-27 16:54:18 +03:00
|
|
|
(load "Test.carp")
|
|
|
|
(use Test)
|
|
|
|
|
2019-03-13 20:49:48 +03:00
|
|
|
(defndynamic _make-exe-path [pth]
|
2020-04-02 16:57:06 +03:00
|
|
|
(let [out (Project.get-config "output-directory")
|
2020-05-12 21:24:40 +03:00
|
|
|
sep (if (or (= (host-os) "windows") (= (host-os) "mingw32")) "\\" "/")
|
2020-04-30 14:32:54 +03:00
|
|
|
lst (Dynamic.String.suffix out (- (String.length out) 1))]
|
|
|
|
(Dynamic.String.concat (array out (if (= lst sep) "" sep) pth))))
|
2018-07-27 16:54:18 +03:00
|
|
|
|
|
|
|
(defmacro make-exe-path [pth]
|
|
|
|
(_make-exe-path pth))
|
|
|
|
|
2018-11-07 18:11:38 +03:00
|
|
|
(deftest test
|
|
|
|
(assert-equal test
|
2020-08-24 12:05:47 +03:00
|
|
|
$[@(make-exe-path "Untitled")]
|
|
|
|
&System.args
|
|
|
|
"System.args works as expected"))
|