-USING: interpolate multiline
-io io.directories io.encodings.ascii io.files
-io.files.temp io.launcher io.streams.string kernel locals system
-tools.test sequences ;
+USING: interpolate io io.encodings.ascii io.files io.files.temp
+io.launcher io.streams.string kernel sequences system ;
IN: alien.remote-control.tests
: compile-file ( contents -- )
try-process ;
: run-test ( -- line )
- os windows? "temp/a.exe" "temp/a.out" ?
+ os windows? "a.exe" "a.out" ?
ascii [ readln ] with-process-reader ;
:: test-embedding ( code -- line )
- image :> image
+ image-path :> image
[
- I[
+ [I
#include <vm/master.h>
#include <stdio.h>
#include <stdbool.h>
printf("Done.\n");
return 0;
}
- ]I
+ I]
] with-string-writer
- "resource:temp" [ compile-file ] with-directory
- "resource:" [ run-test ] with-directory ;
+ [ compile-file ] with-temp-directory
+ [ run-test ] with-temp-directory ;
! [ "Done." ] [ "" test-embedding ] unit-test
-! [ "Done." ] [ "factor_yield();" test-embedding ] unit-test
\ No newline at end of file
+! [ "Done." ] [ "factor_yield();" test-embedding ] unit-test