aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/jobs.c9
-rw-r--r--src/meson.build13
-rw-r--r--src/solver_sjf.c2
-rw-r--r--src/util.c2
4 files changed, 19 insertions, 7 deletions
diff --git a/src/jobs.c b/src/jobs.c
index cb5fe3b..043dac0 100644
--- a/src/jobs.c
+++ b/src/jobs.c
@@ -302,6 +302,8 @@ static int job_read_cache(struct job *job)
i++;
}
+ ret = 0;
+
out_free_line:
free(line);
fclose(nix_build_stream);
@@ -395,6 +397,8 @@ int job_read(FILE *stream, struct job **job)
goto out_free;
}
+ ret = JOB_READ_SUCCESS;
+
out_free:
cJSON_Delete(root);
if (ret != JOB_READ_SUCCESS)
@@ -522,7 +526,6 @@ int jobs_init(FILE **stream, char *expr)
{
size_t argindex;
char *args[4];
- int ret;
argindex = 0;
args[argindex++] = XSTR(NIX_EVAL_JOBS_PATH);
@@ -532,9 +535,7 @@ int jobs_init(FILE **stream, char *expr)
args[argindex++] = NULL;
/* the package is wrapProgram-ed with nix-eval-jobs */
- ret = vpopen(stream, XSTR(NIX_EVAL_JOBS_PATH), args, VPOPEN_STDOUT);
-
- return ret;
+ return vpopen(stream, XSTR(NIX_EVAL_JOBS_PATH), args, VPOPEN_STDOUT);
}
void job_stale_set(struct job *job)
diff --git a/src/meson.build b/src/meson.build
index b88a0da..4217858 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -19,4 +19,15 @@ e = executable(
c_args: [f'-DNIX_EVAL_JOBS_PATH=@NIX_EVAL_JOBS_PATH@'],
)
-test('evanix', e, args: '--help')
+
+foreach solver : ['sjf', 'highs', 'conformity']
+ test(f'evanix-@solver@', e, args: [
+ '--dry-run',
+ '--close-unused-fd=false',
+ '--max-build=3',
+ '--solver-report',
+ f'--solver=@solver@',
+ '--flake',
+ '../#packages.x86_64-linux'
+ ])
+endforeach
diff --git a/src/solver_sjf.c b/src/solver_sjf.c
index 34d85ec..c81f718 100644
--- a/src/solver_sjf.c
+++ b/src/solver_sjf.c
@@ -1,5 +1,5 @@
-#include <queue.h>
#include <errno.h>
+#include <queue.h>
#include "evanix.h"
#include "jobs.h"
diff --git a/src/util.c b/src/util.c
index 2a81670..8ffbb71 100644
--- a/src/util.c
+++ b/src/util.c
@@ -69,7 +69,7 @@ int vpopen(FILE **stream, const char *file, char *const argv[], vpopen_t type)
return -errno;
}
- return 0;
+ return ret;
}
close(fd[0]);