Skip to content

Commit

Permalink
fixed tests i think
Browse files Browse the repository at this point in the history
  • Loading branch information
AleksArt000 committed Aug 25, 2024
1 parent 7c3c91a commit 9f75139
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/test.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,9 @@ void test_move() {

void test_make(char* spm_path) {

// Set environment variables for building
setenv("BUILD_ROOT", build_dir, 1);

Check failure on line 141 in test/test.c

View workflow job for this annotation

GitHub Actions / c-linter

test/test.c:141:26 [clang-diagnostic-error]

use of undeclared identifier 'build_dir'

msg(INFO,"Testing 'make()'..");

init();
Expand All @@ -159,6 +162,21 @@ void test_make(char* spm_path) {

assert(make(legacy_dir,&p) == 0);

// Run 'install' command
if (p.info.install == NULL && strlen(p.info.install) == 0) {
msg(FATAL, "No install command!");
}

char install_cmd[64 + strlen(legacy_dir) + strlen(p.info.install)];
sprintf(install_cmd, "( cd %s && %s )", legacy_dir, p.info.install);

dbg(2, "Executing install command: %s", install_cmd);
if (system(install_cmd) != 0) {
msg(FATAL, "Failed to install %s", p.name);
return -2;

Check failure on line 176 in test/test.c

View workflow job for this annotation

GitHub Actions / c-linter

test/test.c:176:9 [clang-diagnostic-return-type]

void function 'test_make' should not return a value
}
dbg(1, "Install command executed!");

dbg(1,"Getting locations for %s",p.name);
p.locationsCount = get_locations(&p.locations,getenv("SOVIET_BUILD_DIR"));
assert(p.locationsCount > 0);
Expand Down

0 comments on commit 9f75139

Please sign in to comment.