File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ use tempfile::TempDir;
1717
1818#[ path = "util/mod.rs" ]
1919mod util;
20- use crate :: util:: { cargo_dir , ensure_plain_format } ;
20+ use crate :: util:: { ensure_plain_format , tectonic_exe } ;
2121
2222lazy_static ! {
2323 static ref TEST_ROOT : PathBuf = {
@@ -53,9 +53,7 @@ fn get_plain_format_arg() -> String {
5353/// tells the Tectonic binary to go into "test mode" and use local test
5454/// assets, rather than an actual network bundle.
5555fn prep_tectonic ( cwd : & Path , args : & [ & str ] ) -> Command {
56- let tectonic = cargo_dir ( )
57- . join ( "tectonic" )
58- . with_extension ( env:: consts:: EXE_EXTENSION ) ;
56+ let tectonic = tectonic_exe ( ) ;
5957
6058 if fs:: metadata ( & tectonic) . is_err ( ) {
6159 panic ! ( "tectonic binary not found at {tectonic:?}. Do you need to run `cargo build`?" )
Original file line number Diff line number Diff line change @@ -36,20 +36,9 @@ pub fn set_test_root() {
3636 :: tectonic:: test_util:: set_test_root_augmented ( env ! ( "CARGO_MANIFEST_DIR" ) ) ;
3737}
3838
39- // Duplicated from Cargo's own testing code:
40- // https://github.com/rust-lang/cargo/blob/19fdb308/tests/cargotest/support/mod.rs#L305-L318
41- pub fn cargo_dir ( ) -> PathBuf {
42- env:: var_os ( "CARGO_BIN_PATH" )
39+ pub fn tectonic_exe ( ) -> PathBuf {
40+ env:: var_os ( "CARGO_BIN_EXE_tectonic" )
4341 . map ( PathBuf :: from)
44- . or_else ( || {
45- env:: current_exe ( ) . ok ( ) . map ( |mut path| {
46- path. pop ( ) ;
47- if path. ends_with ( "deps" ) {
48- path. pop ( ) ;
49- }
50- path
51- } )
52- } )
5342 . unwrap_or_else ( || panic ! ( "CARGO_BIN_PATH wasn't set. Cannot continue running test" ) )
5443}
5544
You can’t perform that action at this time.
0 commit comments