Skip to content

Commit

Permalink
Stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
MoonlightSentinel committed Feb 5, 2022
1 parent 9e18161 commit 50a692c
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions test/dshell/defaults.d
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ void testConfigurations()
// Static configuration file for the final release
string configPath = buildNormalizedPath(dirName(__FILE_FULL_PATH__), "..", "..", "ini", OS, config);

string extraArgs;

version (Windows) if (MODEL == "32omf")
{
// 32-OMF tries to use `optlink.exe` located next to `sc.ini`
Expand All @@ -52,11 +54,11 @@ void testConfigurations()
assert(fixed !is content, "Patching failed!");

const LIB = environment["LIB"].findSplitBefore(";")[0];
const withLib = fixed.replace(`LIB="%@P%\..\lib"`, `LIB="` ~ LIB ~ `"`);
assert(withLib !is fixed, "Patching 2 failed");
writeln("LIB = ", LIB);
extraArgs = buildPath(LIB, "phobos.lib");

writeln("\nNew config file:\n======================================");
writeln(withLib);
writeln(fixed);
writeln("======================================");
stdout.flush();

Expand All @@ -67,7 +69,7 @@ void testConfigurations()

// Save the new file
configPath = buildPath(OUTPUT_BASE, baseName(configPath));
std.file.write(configPath, withLib);
std.file.write(configPath, fixed);
}

// Flag sets to test
Expand All @@ -80,10 +82,10 @@ void testConfigurations()

// Override these environment variables s.t. they don't mess with the values found in the configuration files
string[string] env;
// version (Windows) env = [
// "DFLAGS": "",
// "LIB": "",
// ];
version (Windows) if (MODEL == "32omf") env = [
"DFLAGS": "",
"LIB": "",
];

foreach (const target; targets)
{
Expand All @@ -94,7 +96,8 @@ void testConfigurations()
~ ` -I$EXTRA_FILES/defaults `
~ DFLAGS
~ ` $EXTRA_FILES/defaults/hello.d `
~ ` -of=$OUTPUT_BASE/hello$EXE `,
~ ` -of=$OUTPUT_BASE/hello$EXE `
~ extraArgs,
stdout, stderr, env,
);

Expand Down

0 comments on commit 50a692c

Please sign in to comment.