about summary refs log tree commit diff
path: root/tests/init.sh
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2004-05-04T12·15+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2004-05-04T12·15+0000
commit256eeab7112da2d5fe1629ffb8b86640a894ee6d (patch)
treed173bcf930f86c296793a0cd20c7c83900c0bd18 /tests/init.sh
parentfd927c5d25f1518dcbf99a57223f46fe098d9011 (diff)
* Allow the location of the store etc. to be specified using
  environment variables.
* Started adding some automatic tests.
* Do a `make check' when building RPMs.

Diffstat (limited to 'tests/init.sh')
-rw-r--r--tests/init.sh18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/init.sh b/tests/init.sh
new file mode 100644
index 0000000000..87ab59f964
--- /dev/null
+++ b/tests/init.sh
@@ -0,0 +1,18 @@
+test -n "$TEST_ROOT"
+if test -d "$TEST_ROOT"; then
+    chmod -R u+w "$TEST_ROOT"
+    rm -rf "$TEST_ROOT"
+fi
+mkdir "$TEST_ROOT"
+
+mkdir "$NIX_STORE_DIR"
+mkdir "$NIX_DATA_DIR"
+mkdir "$NIX_LOG_DIR"
+mkdir "$NIX_STATE_DIR"
+mkdir "$NIX_DB_DIR"
+
+# Initialise the database.
+$TOP/src/nix-store/nix-store --init
+
+# Did anything happen?
+test -e "$NIX_DB_DIR"/validpaths